Which code segment or XAML fragment should you use?

You are developing a Silverlight 4 application. You define the visual behavior of a custom control in the ControlTemplate by defining a VisualState object named Selected. You need to change the visual state of the custom control to the selected state. Which code segment or XAML fragment should you use?

You are developing a Silverlight 4 application. You define the visual behavior of a custom control in the ControlTemplate by defining a VisualState object named Selected. You need to change the visual state of the custom control to the selected state. Which code segment or XAML fragment should you use?

A.
VisualStateManager.GoToState( this, “Selected”, true );

B.
<VisualTransition To=”Selected”>
<Storyboard>
</Storyboard>
</VisualTransition>

C.
<VisualTransition From=”Selected”>
<Storyboard>
</Storyboard>
</VisualTransition>

D.
public static readonly DependencyProperty SelectedProperty = DependencyProperty.Register(“Selected”, typeof(VisualState), typeof(MyControl), null);
public VisualState Selected
{
get { return (VisualState)GetValue(SelectedProperty); }
set { SetValue(SelectedProperty, value); }
}



Leave a Reply 0

Your email address will not be published. Required fields are marked *