Silverlight – WP7: Change the visibility of the project in the selected list box project

I have a list box in which the following data templates are defined:











List box:

The problem is as follows; when the user selects an item in the list box, I want to display other information by setting the visibility of the stackpanel to visible.

Any idea how To achieve this (via xaml or c#)? I tried to change the storyboard, but I did not adopt this method.

Create an ItemContainerStyle, which has The default ContentControl to display the content of the ItemTemplate, but also has the detailed information content defined using the Visibility setting to Collapsed. Then, update the “Selected” VisualState to set the Visibility of the details panel to Visible:

< p>



Storyboard.TargetName="ContentContainer" >


Storyboard.TargetName ="Details">




...

x:Name="ContentContainer"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment= "{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>



I have one List box, which defines the following data templates:










< br />

List Box:

The problem is as follows; when the user selects an item in the list box, I want to display other information by setting the visibility of the stackpanel to visible.

Any The idea is how to achieve this (via xaml or c#)? I tried to change the storyboard, but I did not adopt this method.

Create an ItemContainerStyle, which has a default ContentControl to display the contents of the ItemTemplate, but also has Use the Visibility setting to set the detailed information content defined by Collapsed. Then, update the “Selected” VisualState to set the Visibility of the details panel to Visible:



Storyboard.TargetName="ContentContainer">


Storyboard.TargetName="Details">




...
< br /> x:Name="ContentContainer"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{ TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>

Leave a Comment

Your email address will not be published.