I create many views Now I have a view which has a ListView. The ListView has a toggle button in the header. It can be expanded or collapsed.
<ListView>
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StatckResource ListViewHeaders}">
<GridViewColumn CellTemplate="{StaticResource myCellTemplate}" />
</GridView>
</ListView.View>
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Background" Value="Red" />
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
The question is that the ListViewItems must be the components in other Views. The definition of the component is something like a gridview in other view or a stackpanel in other view or maybe just a button in other view.
When the page is loaded, all ListView items are collapsed. When I click the toggle button(expander), the items should be expanded.
My question is I don't know how to add/insert the components in other views into this ListView. I think that we may find some x:Name
something like. But just don't know.
Need code sample.