Assembly: System.Windows (in System.Windows.dll)
Dependency property identifier field: VisibilityProperty
Elements where is not Visible do not participate in input events, are not in a tab sequence (cannot be focused), and are excluded during hit testing.
The value of IsHitTestVisible is ignored when an object is not set to Visible. IsHitTestVisible is a settable property that enables you to disable hit testing for objects that would otherwise be hit testable by virtue of the and Background property values.
The reason that uses an enumeration rather than a simple Boolean is that this area of the Silverlight object model is modeled on the Windows Presentation Foundation (WPF) Visibility property, which uses a three-state model for Visibility of Visible/Hidden/Collapsed. In the WPF model, Hidden denotes a visibility state where the object should not render, but should still occupy space in a WPF layout. Silverlight does not support Hidden. If you are importing XAML UI definitions from WPF, you might need to change the cases where a Visibility is declared as Hidden in order to use that XAML in Silverlight.
For more information on the XAML syntax, see Visibility.
Visibility in a Visual State
As part of defining visual states for a control, you will sometimes want to change the state of an object to Collapsed. Visual states rely on animations. The property value type of is Visibility, an enumeration. To animate values that are enumerations, you must use a DiscreteObjectKeyFrame. (You also use this technique for Boolean values).
The following XAML example shows a visual state that uses DiscreteObjectKeyFrame to change visibility.
<VisualState x:Name="Focused"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility" Duration="0"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState>
For more information on the visual state model for controls, see Creating a New Control by Creating a ControlTemplate.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.