SplitOpenThemeAnimation SplitOpenThemeAnimation SplitOpenThemeAnimation SplitOpenThemeAnimation Class

Definition

Represents the preconfigured animation that reveals a target UI using a split animation.

public : sealed class SplitOpenThemeAnimation : Timeline, ISplitOpenThemeAnimation
struct winrt::Windows::UI::Xaml::Media::Animation::SplitOpenThemeAnimation : Timeline, ISplitOpenThemeAnimation
public sealed class SplitOpenThemeAnimation : Timeline, ISplitOpenThemeAnimation
Public NotInheritable Class SplitOpenThemeAnimation Inherits Timeline Implements ISplitOpenThemeAnimation
<SplitOpenThemeAnimation .../>
Inheritance
SplitOpenThemeAnimationSplitOpenThemeAnimationSplitOpenThemeAnimationSplitOpenThemeAnimation
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following is an example of a custom control that uses split open and split close theme animations.


<!-- Example template of a custom control that uses split open 
     and split close theme animations. -->
<ControlTemplate TargetType="local:SplitOpenControl">
    <Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="OpenStates">
                <VisualState x:Name="Open">
                    <Storyboard>
                        <SplitOpenThemeAnimation 
                            OpenedTargetName="contentBorder" 
                            ContentTargetName="content" 
                            ClosedTargetName="targetRect"
                            ContentTranslationDirection="Left"
                            ContentTranslationOffset="200"  
                            OffsetFromCenter="0"
                            OpenedLength="200"
                            ClosedLength="0"
                 />
                        <DoubleAnimation 
                            Storyboard.TargetName="targetRect" 
                            Storyboard.TargetProperty="Opacity" 
                            To="0" 
                            Duration="0" 
                 />
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Closed">
                    <Storyboard>
                        <SplitCloseThemeAnimation
                            OpenedTargetName="contentBorder" 
                            ContentTargetName="content" 
                            ClosedTargetName="targetRect"
                            ContentTranslationDirection="Left"
                            ContentTranslationOffset="-200"  
                            OffsetFromCenter="0"
                            OpenedLength="200"
                            ClosedLength="0"
                 />
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Rectangle x:Name="targetRect" Width="100" Height="100" Fill="Blue"/>

        <Popup IsOpen="False" Height="50" Width="200" x:Name="contentPopup">
            <Border x:Name="contentBorder" BorderBrush="Orange" BorderThickness="3">
                <TextBlock x:Name="content" Text="Hello World" FontSize="20"/>
            </Border>
        </Popup>
    </Grid>
</ControlTemplate>
public sealed class SplitOpenControl : Control
{
    private Popup _contentPopup;
    public SplitOpenControl()
    {
        this.DefaultStyleKey = typeof(SplitOpenControl);
    }

    protected override void OnApplyTemplate()
    {
        base.OnApplyTemplate();
        _contentPopup = GetTemplateChild("contentPopup") as Popup;
    }

    protected override void OnPointerPressed(PointerRoutedEventArgs e)
    {
        this.CapturePointer(e.Pointer);
        _contentPopup.IsOpen = true;
        VisualStateManager.GoToState(this, "Open", true);            
    }

    protected override void OnPointerReleased(PointerRoutedEventArgs e)
    {            
        VisualStateManager.GoToState(this, "Closed", true);
        this.ReleasePointerCapture(e.Pointer);
    }
}
// SplitOpenControl.h:
public ref class SplitOpenControl sealed : public Windows::UI::Xaml::Controls::Control
{
public:
    SplitOpenControl();
protected:
    virtual void OnApplyTemplate() override;
    virtual void OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) override;
    virtual void OnPointerReleased(Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) override;
private:
    Windows::UI::Xaml::Controls::Primitives::Popup^ m_contentPopup;
};

// SplitOpenControl.cpp:
SplitOpenControl::SplitOpenControl()
{
    DefaultStyleKey = "MyApp.SplitOpenControl";
}

void SplitOpenControl::OnApplyTemplate()
{
    m_contentPopup = static_cast<Popup^>(GetTemplateChild("contentPopup"));
}

void SplitOpenControl::OnPointerPressed(PointerRoutedEventArgs^ e)
{
    CapturePointer(e->Pointer);
    m_contentPopup->IsOpen = true;
    VisualStateManager::GoToState(this, "Open", true);
}

void SplitOpenControl::OnPointerReleased(PointerRoutedEventArgs^ e)
{
    VisualStateManager::GoToState(this, "Closed", true);
    ReleasePointerCapture(e->Pointer);
}

Remarks

Note that setting the Duration property has no effect on this object since the duration is preconfigured.

Constructors

SplitOpenThemeAnimation() SplitOpenThemeAnimation() SplitOpenThemeAnimation() SplitOpenThemeAnimation()

Initializes a new instance of the SplitOpenThemeAnimation class.

public : SplitOpenThemeAnimation()
SplitOpenThemeAnimation() const;
public SplitOpenThemeAnimation()
Public Sub New()

Properties

AllowDependentAnimations AllowDependentAnimations AllowDependentAnimations AllowDependentAnimations

Gets or sets a value that determines whether dependent animations should be permitted to run, throughout the app.

(Inherited from Timeline)

AutoReverse AutoReverse AutoReverse AutoReverse

Gets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration.

(Inherited from Timeline)

AutoReverseProperty AutoReverseProperty AutoReverseProperty AutoReverseProperty

Identifies the AutoReverse dependency property.

(Inherited from Timeline)

BeginTime BeginTime BeginTime BeginTime

Gets or sets the time at which this Timeline should begin.

(Inherited from Timeline)

BeginTimeProperty BeginTimeProperty BeginTimeProperty BeginTimeProperty

Identifies the BeginTime dependency property.

(Inherited from Timeline)

ClosedLength ClosedLength ClosedLength ClosedLength

Gets or sets the initial size of the target element in the animation direction.

public : double ClosedLength { get; set; }
double ClosedLength(); void ClosedLength(double closedlength);
public double ClosedLength { get; set; }
Public ReadWrite Property ClosedLength As double
<SplitOpenThemeAnimation ClosedLength="double"/>
Value
double double

The initial size of the target in pixels.

ClosedLengthProperty ClosedLengthProperty ClosedLengthProperty ClosedLengthProperty

Identifies the ClosedLength dependency property.

public : static DependencyProperty ClosedLengthProperty { get; }
static DependencyProperty ClosedLengthProperty();
public static DependencyProperty ClosedLengthProperty { get; }
Public Static ReadOnly Property ClosedLengthProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ClosedLength dependency property.

ClosedTarget ClosedTarget ClosedTarget ClosedTarget

Gets or sets the UI element that specifies the initial clip size.

public : DependencyObject ClosedTarget { get; set; }
DependencyObject ClosedTarget(); void ClosedTarget(DependencyObject closedtarget);
public DependencyObject ClosedTarget { get; set; }
Public ReadWrite Property ClosedTarget As DependencyObject
Value
DependencyObject DependencyObject

The the UI element that specifies the initial clip size.

Remarks

Don't set this in XAML. For a XAML declaration, use ClosedTargetName instead.

ClosedTargetName ClosedTargetName ClosedTargetName ClosedTargetName

Gets or sets the identifying name of the UI element that specifies the initial clip size.

public : Platform::String ClosedTargetName { get; set; }
winrt::hstring ClosedTargetName(); void ClosedTargetName(winrt::hstring closedtargetname);
public string ClosedTargetName { get; set; }
Public ReadWrite Property ClosedTargetName As string
<SplitOpenThemeAnimation ClosedTargetName="nameString" />
Value
string string

The reference name. This is typically the x:Name of the relevant element as declared in XAML.

ClosedTargetNameProperty ClosedTargetNameProperty ClosedTargetNameProperty ClosedTargetNameProperty

Identifies the ClosedTargetName dependency property.

public : static DependencyProperty ClosedTargetNameProperty { get; }
static DependencyProperty ClosedTargetNameProperty();
public static DependencyProperty ClosedTargetNameProperty { get; }
Public Static ReadOnly Property ClosedTargetNameProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ClosedTargetName dependency property.

ClosedTargetProperty ClosedTargetProperty ClosedTargetProperty ClosedTargetProperty

Identifies the ClosedTarget dependency property.

public : static DependencyProperty ClosedTargetProperty { get; }
static DependencyProperty ClosedTargetProperty();
public static DependencyProperty ClosedTargetProperty { get; }
Public Static ReadOnly Property ClosedTargetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ClosedTarget dependency property.

ContentTarget ContentTarget ContentTarget ContentTarget

Gets or sets the UI element that will be translated. Typically this is a child/part of the element identified by OpenedTargetName or OpenedTarget.

public : DependencyObject ContentTarget { get; set; }
DependencyObject ContentTarget(); void ContentTarget(DependencyObject contenttarget);
public DependencyObject ContentTarget { get; set; }
Public ReadWrite Property ContentTarget As DependencyObject
Value
DependencyObject DependencyObject

The UI element that will be translated.

Remarks

Don't set this in XAML. For a XAML declaration, use ContentTargetName instead.

ContentTargetName ContentTargetName ContentTargetName ContentTargetName

Gets or sets the identifying name of the UI element that will be translated. Typically this is a child/part of the element identified by OpenedTargetName.

public : Platform::String ContentTargetName { get; set; }
winrt::hstring ContentTargetName(); void ContentTargetName(winrt::hstring contenttargetname);
public string ContentTargetName { get; set; }
Public ReadWrite Property ContentTargetName As string
<SplitOpenThemeAnimation ContentTargetName="nameString" />
Value
string string

The reference name. This is typically the x:Name of the relevant element as declared in XAML.

ContentTargetNameProperty ContentTargetNameProperty ContentTargetNameProperty ContentTargetNameProperty

Identifies the ContentTargetName dependency property.

public : static DependencyProperty ContentTargetNameProperty { get; }
static DependencyProperty ContentTargetNameProperty();
public static DependencyProperty ContentTargetNameProperty { get; }
Public Static ReadOnly Property ContentTargetNameProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ContentTargetName dependency property.

ContentTargetProperty ContentTargetProperty ContentTargetProperty ContentTargetProperty

Identifies the ContentTarget dependency property.

public : static DependencyProperty ContentTargetProperty { get; }
static DependencyProperty ContentTargetProperty();
public static DependencyProperty ContentTargetProperty { get; }
Public Static ReadOnly Property ContentTargetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ContentTarget dependency property.

ContentTranslationDirection ContentTranslationDirection ContentTranslationDirection ContentTranslationDirection

Gets or sets a value that determines which direction the content should translate when the animation runs.

public : AnimationDirection ContentTranslationDirection { get; set; }
AnimationDirection ContentTranslationDirection(); void ContentTranslationDirection(AnimationDirection contenttranslationdirection);
public AnimationDirection ContentTranslationDirection { get; set; }
Public ReadWrite Property ContentTranslationDirection As AnimationDirection
<SplitOpenThemeAnimation ContentTranslationDirection="animationDirectionMemberName" />
Value
AnimationDirection AnimationDirection

A value of the enumeration.

ContentTranslationDirectionProperty ContentTranslationDirectionProperty ContentTranslationDirectionProperty ContentTranslationDirectionProperty

Identifies the ContentTranslationDirection dependency property.

public : static DependencyProperty ContentTranslationDirectionProperty { get; }
static DependencyProperty ContentTranslationDirectionProperty();
public static DependencyProperty ContentTranslationDirectionProperty { get; }
Public Static ReadOnly Property ContentTranslationDirectionProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ContentTranslationDirection dependency property.

ContentTranslationOffset ContentTranslationOffset ContentTranslationOffset ContentTranslationOffset

Gets or sets the pixels to translate by when the animation runs.

public : double ContentTranslationOffset { get; set; }
double ContentTranslationOffset(); void ContentTranslationOffset(double contenttranslationoffset);
public double ContentTranslationOffset { get; set; }
Public ReadWrite Property ContentTranslationOffset As double
<SplitOpenThemeAnimation ContentTranslationOffset="double" />
Value
double double

A distance in pixels.

ContentTranslationOffsetProperty ContentTranslationOffsetProperty ContentTranslationOffsetProperty ContentTranslationOffsetProperty

Identifies the ContentTranslationOffset dependency property.

public : static DependencyProperty ContentTranslationOffsetProperty { get; }
static DependencyProperty ContentTranslationOffsetProperty();
public static DependencyProperty ContentTranslationOffsetProperty { get; }
Public Static ReadOnly Property ContentTranslationOffsetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ContentTranslationOffset dependency property.

Dispatcher Dispatcher Dispatcher 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.

(Inherited from DependencyObject)

Duration Duration Duration Duration

Gets or sets the length of time for which this timeline plays, not counting repetitions.

(Inherited from Timeline)

DurationProperty DurationProperty DurationProperty DurationProperty

Identifies the Duration dependency property.

(Inherited from Timeline)

FillBehavior FillBehavior FillBehavior FillBehavior

Gets or sets a value that specifies how the animation behaves after it reaches the end of its active period.

(Inherited from Timeline)

FillBehaviorProperty FillBehaviorProperty FillBehaviorProperty FillBehaviorProperty

Identifies the FillBehavior dependency property.

(Inherited from Timeline)

OffsetFromCenter OffsetFromCenter OffsetFromCenter OffsetFromCenter

Gets or sets an offset from the center of the opened target.

public : double OffsetFromCenter { get; set; }
double OffsetFromCenter(); void OffsetFromCenter(double offsetfromcenter);
public double OffsetFromCenter { get; set; }
Public ReadWrite Property OffsetFromCenter As double
<SplitOpenThemeAnimation OffsetFromCenter="double" />
Value
double double

An offset in pixels. The default is 0.

OffsetFromCenterProperty OffsetFromCenterProperty OffsetFromCenterProperty OffsetFromCenterProperty

Identifies the OffsetFromCenter dependency property.

public : static DependencyProperty OffsetFromCenterProperty { get; }
static DependencyProperty OffsetFromCenterProperty();
public static DependencyProperty OffsetFromCenterProperty { get; }
Public Static ReadOnly Property OffsetFromCenterProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the OffsetFromCenter dependency property.

OpenedLength OpenedLength OpenedLength OpenedLength

Gets or sets the final size of the target UI element.

public : double OpenedLength { get; set; }
double OpenedLength(); void OpenedLength(double openedlength);
public double OpenedLength { get; set; }
Public ReadWrite Property OpenedLength As double
<SplitOpenThemeAnimation OpenedLength="double" />
Value
double double

The final size. If left unset, the value defaults to the size of the opened target.

OpenedLengthProperty OpenedLengthProperty OpenedLengthProperty OpenedLengthProperty

Identifies the OpenedLength dependency property.

public : static DependencyProperty OpenedLengthProperty { get; }
static DependencyProperty OpenedLengthProperty();
public static DependencyProperty OpenedLengthProperty { get; }
Public Static ReadOnly Property OpenedLengthProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the OpenedLength dependency property.

OpenedTarget OpenedTarget OpenedTarget OpenedTarget

Gets or sets the UI element that will be clipped.

public : DependencyObject OpenedTarget { get; set; }
DependencyObject OpenedTarget(); void OpenedTarget(DependencyObject openedtarget);
public DependencyObject OpenedTarget { get; set; }
Public ReadWrite Property OpenedTarget As DependencyObject
Value
DependencyObject DependencyObject

The UI element that will be clipped.

Remarks

Don't set this in XAML. For a XAML declaration, use OpenedTargetName instead.

OpenedTargetName OpenedTargetName OpenedTargetName OpenedTargetName

Gets or sets the identifying name of the UI element that will be clipped.

public : Platform::String OpenedTargetName { get; set; }
winrt::hstring OpenedTargetName(); void OpenedTargetName(winrt::hstring openedtargetname);
public string OpenedTargetName { get; set; }
Public ReadWrite Property OpenedTargetName As string
<SplitOpenThemeAnimation OpenedTargetName="nameString" />
Value
string string

The reference name. This is typically the x:Name of the relevant element as declared in XAML.

OpenedTargetNameProperty OpenedTargetNameProperty OpenedTargetNameProperty OpenedTargetNameProperty

Identifies the OpenedTargetName dependency property.

public : static DependencyProperty OpenedTargetNameProperty { get; }
static DependencyProperty OpenedTargetNameProperty();
public static DependencyProperty OpenedTargetNameProperty { get; }
Public Static ReadOnly Property OpenedTargetNameProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the OpenedTargetName dependency property.

OpenedTargetProperty OpenedTargetProperty OpenedTargetProperty OpenedTargetProperty

Identifies the OpenedTarget dependency property.

public : static DependencyProperty OpenedTargetProperty { get; }
static DependencyProperty OpenedTargetProperty();
public static DependencyProperty OpenedTargetProperty { get; }
Public Static ReadOnly Property OpenedTargetProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the OpenedTarget dependency property.

RepeatBehavior RepeatBehavior RepeatBehavior RepeatBehavior

Gets or sets the repeating behavior of this timeline.

(Inherited from Timeline)

RepeatBehaviorProperty RepeatBehaviorProperty RepeatBehaviorProperty RepeatBehaviorProperty

Identifies the RepeatBehavior dependency property.

(Inherited from Timeline)

SpeedRatio SpeedRatio SpeedRatio SpeedRatio

Gets or sets the rate, relative to its parent, at which time progresses for this Timeline.

(Inherited from Timeline)

SpeedRatioProperty SpeedRatioProperty SpeedRatioProperty SpeedRatioProperty

Identifies for the SpeedRatio dependency property.

(Inherited from Timeline)

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

Events

Completed Completed Completed Completed

Occurs when the Storyboard object has completed playing.

(Inherited from Timeline)

See Also