Show or hide an object in your application
You have multiple options for hiding objects in your application. The option that you select depends on which of the following results you want:
To create an instantaneous change in visibility, use the Visibility property.
To animate a gradual change in visibility, use the Opacity property under Appearance, or use the Alpha property in the color picker under Brush.
Hinweis |
---|
Hiding an object in your application hides all its child objects, if any exist. |
Hinweis |
---|
Hiding an object on the artboard can make it easier to see other objects while you design your application. To hide a specific object, use the Hide/Show toggle. For more information, see Show or hide an object on the artboard. |
To show or hide an object instantaneously
In the Tools panel in Blend for Visual Studio 2012, click Selection, and then select the object whose visibility you want to change.
Under Appearance in the Properties panel, click the arrow next to the drop-down list for the Visibility property, and then select one of the following options:
Visible To show the object in your application.
Hidden To hide the object in your application but let it maintain its layout proportions on the artboard.
Vorsicht Hidden is only available in Windows Presentation Foundation (WPF) projects. Microsoft Silverlight does not support the Hidden value for the Visibility property.
Collapsed To hide the object in your application in a minimized state so that it does not maintain its layout proportions. In other words, the size of the parent object will be reduced accordingly if the size of the parent object relies on the size of the collapsed child object.
To animate a gradual change in visibility
In the Tools panel in Blend, click Selection, and then select the object whose visibility you want to change.
In an animation timeline, move the timeline playhead to the time where you want to change the visibility of the object.
For an example of creating an animation timeline, see Create a simple animation.
Select one of the following options to create a keyframe on the animation timeline:
Opacity Under Appearance in the Properties panel, adjust the value of the Opacity property. For example, an opacity value of 0 percent makes the object invisible.
Alpha Under Brush in the Properties panel, adjust the value of the Alpha property. For example, an alpha value of 0 percent makes the object invisible.
Hinweis You can adjust the Alpha value only for a Solid color brush or a Gradient brush. You cannot adjust the Alpha value of a brush resource, and you cannot animate from No brush to a brush.
Test your animation by clicking Play . The timeline will animate a gradual change between the original value of the Opacity or Alpha property to the new value.