Popup.PopupAnimation 属性

定义

获取或设置 Popup 控件的打开和关闭动画。Gets or sets an animation for the opening and closing of a Popup control.

public:
 property System::Windows::Controls::Primitives::PopupAnimation PopupAnimation { System::Windows::Controls::Primitives::PopupAnimation get(); void set(System::Windows::Controls::Primitives::PopupAnimation value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.Primitives.PopupAnimation PopupAnimation { get; set; }
member this.PopupAnimation : System.Windows.Controls.Primitives.PopupAnimation with get, set
Public Property PopupAnimation As PopupAnimation

属性值

PopupAnimation 枚举值,该值定义打开和关闭 Popup 控件的动画。The PopupAnimation enumeration value that defines an animation to open and close a Popup control. 默认值为 NoneThe default is None.

属性

示例

下面的示例演示如何设置 PopupAnimation 属性。The following example shows how to set the PopupAnimation property.

myPopup.AllowsTransparency = true;
myPopup.AllowsTransparency = True
<DockPanel  Width="500" Background="Aqua">
  <Popup Placement="Center" PlacementRectangle="0,0,30,50"  
          IsOpen ="True" AllowsTransparency="True"
          PopupAnimation="Fade">
    <TextBlock Background="Purple">Popup Text</TextBlock>
  </Popup>
</DockPanel>
myTextBlockPopup.PopupAnimation = PopupAnimation.Fade;
myTextBlockPopup.PopupAnimation = PopupAnimation.Fade

注解

仅当属性设置为true时,才能进行动画处理。Popup AllowsTransparencyA Popup can only animate when the AllowsTransparency property is set to true. 这需要创建Popup控件的应用程序以完全信任的方式运行。This requires the application that creates the Popup control to run with full trust.

如果已进行动画处理, Popup则将不会对进行动画处理。 PlacementTargetIf the PlacementTarget is animated, the Popup will not be animated.

依赖项属性信息Dependency Property Information

标识符字段Identifier field PopupAnimationProperty
元数据属性设置为trueMetadata properties set to true NoneNone

适用于

另请参阅