Hi Guys,
In the following XAML, how can I use _xyzStackPanel
in the code behind? Is this not possible when we use DataTemplate
? I need to show/hide this stackpanel, what is the best way?
Can I use the VisualStateManager
here? Could someone provide example please, thanks.
<ListBox ... >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Name="_xyzStackPanel" ...>
..............
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Thanks,
Voodoo
EDIT:
I wonder if it would be better to add the StackPanel in the codebehind instead of always having it there and hiding it......BUT, how can I add to the DataTemplate in the codebehind?