FadeOutThemeAnimation Class
Definition
Represents the preconfigured opacity animation that applies to controls when they are removed from the UI or hidden.
Equivalent WinUI class: Microsoft.UI.Xaml.Media.Animation.FadeOutThemeAnimation.
public ref class FadeOutThemeAnimation sealed : Timeline
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Media.Animation.IFadeOutThemeAnimationStatics, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class FadeOutThemeAnimation sealed : Timeline
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Media.Animation.IFadeOutThemeAnimationStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class FadeOutThemeAnimation sealed : Timeline
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Media.Animation.IFadeOutThemeAnimationStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class FadeOutThemeAnimation : Timeline
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Media.Animation.IFadeOutThemeAnimationStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class FadeOutThemeAnimation : Timeline
Public NotInheritable Class FadeOutThemeAnimation
Inherits Timeline
<FadeOutThemeAnimation ... />
- Inheritance
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
The following example applies a FadeInThemeAnimation and FadeOutThemeAnimation to a rectangle.
<StackPanel>
<StackPanel.Resources>
<!-- Theme animations like this can use the default behavior like
this example or you could use properties like BeginTime and
Duration to tweak when and how quickly the animation occures.
If you want more control over a fade animation (e.g. just partial
fade), you will need to use DoubleAnimation to animate the Opacity
property of the element you want to fade in or out. -->
<Storyboard x:Name="EnterStoryboard">
<FadeOutThemeAnimation Storyboard.TargetName="myRectangle" />
</Storyboard>
<Storyboard x:Name="ExitStoryboard">
<FadeInThemeAnimation Storyboard.TargetName="myRectangle" />
</Storyboard>
</StackPanel.Resources>
<Rectangle x:Name="myRectangle"
PointerEntered="Rectangle_PointerEntered"
PointerExited="Rectangle_PointerExited"
Fill="Blue" Width="200" Height="300" />
</StackPanel>
// When the pointer enters the rectangle space, the animation begins.
private void Rectangle_PointerEntered(object sender, PointerRoutedEventArgs e)
{
EnterStoryboard.Begin();
}
private void Rectangle_PointerExited(object sender, PointerRoutedEventArgs e)
{
ExitStoryboard.Begin();
}
Constructors
FadeOutThemeAnimation() |
Initializes a new instance of the FadeOutThemeAnimation class. Equivalent WinUI constructor: Microsoft.UI.Xaml.Media.Animation.FadeOutThemeAnimation.FadeOutThemeAnimation. |
Properties
AutoReverse |
Gets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.AutoReverse. (Inherited from Timeline) |
BeginTime |
Gets or sets the time at which this Timeline should begin. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.BeginTime. (Inherited from Timeline) |
Dispatcher |
Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. Equivalent WinUI property: Microsoft.UI.Xaml.DependencyObject.Dispatcher. (Inherited from DependencyObject) |
Duration |
Gets or sets the length of time for which this timeline plays, not counting repetitions. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.Duration. (Inherited from Timeline) |
FillBehavior |
Gets or sets a value that specifies how the animation behaves after it reaches the end of its active period. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.FillBehavior. (Inherited from Timeline) |
RepeatBehavior |
Gets or sets the repeating behavior of this timeline. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.RepeatBehavior. (Inherited from Timeline) |
SpeedRatio |
Gets or sets the rate, relative to its parent, at which time progresses for this Timeline. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.Timeline.SpeedRatio. (Inherited from Timeline) |
TargetName |
Gets or sets the reference name of the control element being targeted. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.FadeOutThemeAnimation.TargetName. |
TargetNameProperty |
Identifies the TargetName dependency property. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Animation.FadeOutThemeAnimation.TargetNameProperty. |
Methods
Events
Completed |
Occurs when the Storyboard object has completed playing. Equivalent WinUI event: Microsoft.UI.Xaml.Media.Animation.Timeline.Completed. (Inherited from Timeline) |