Hello @Chirag Pokiya ,
Welcome to our Microsoft Q&A platform!
To achieve the function as the pictures shown, try using Community.Toolkit.Expander control which provides an expandable container to host any content. Here is the related doc, you could refer to it: https://learn.microsoft.com/en-us/xamarin/community-toolkit/views/expander#create-expander-content-on-demand
However, the expandable container should only be expanded when clicking the comment menu in the picture. So we need to make a little change, try to remove the Expander.Header
template and use the button/menu to change the expanding status instead. Here is the sample code, you could refer to it:
<ContentPage ...
xmlns:xct="http://xamarin.com/schemas/2020/toolkit">
<ContentPage.Content>
<StackLayout>
<Button Text="button" Clicked="Button_Clicked" />
<xct:Expander x:Name="expander" BackgroundColor="LightBlue">
<xct:Expander.ContentTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="yali"
Aspect="AspectFill"
HeightRequest="120"
WidthRequest="120" />
<Label Grid.Column="1"
Text="Details"
FontAttributes="Italic" />
</Grid>
</DataTemplate>
</xct:Expander.ContentTemplate>
</xct:Expander>
</StackLayout>
</ContentPage.Content>
</ContentPage>
//button click event
private async void Button_Clicked(object sender, EventArgs e)
{
expander.IsExpanded = !expander.IsExpanded;
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.