Popup.PopupAnimation Property

Definition

Gets or sets an animation for the opening and closing of a Popup control.

C#
[System.ComponentModel.Bindable(true)]
public System.Windows.Controls.Primitives.PopupAnimation PopupAnimation { get; set; }

Property Value

The PopupAnimation enumeration value that defines an animation to open and close a Popup control. The default is None.

Attributes

Examples

The following example shows how to set the PopupAnimation property.

C#
myPopup.AllowsTransparency = true;
XAML
<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>
C#
myTextBlockPopup.PopupAnimation = PopupAnimation.Fade;

Remarks

A Popup can only animate when the AllowsTransparency property is set to true. This requires the application that creates the Popup control to run with full trust.

If the PlacementTarget is animated, the Popup will not be animated.

Dependency Property Information

Item Value
Identifier field PopupAnimationProperty
Metadata properties set to true None

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also