ContentThemeTransition Class

提供動畫轉換行為用於控制項內容正在變更時。除了 AddDeleteThemeTransition 以外,可能會套用此項目。

繼承

Object
  DependencyObject
    Transition
      ContentThemeTransition

語法


public sealed class ContentThemeTransition : Transition


<ContentThemeTransition ... />

屬性

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

成員

ContentThemeTransition類別 具有下列類型的成員:

建構函式

ContentThemeTransition類別 具有這些建構函式。

建構函式描述
ContentThemeTransition Initializes a new instance of the ContentThemeTransition class.

 

方法

The ContentThemeTransition 類別 擁有這些方法。 它也會繼承方法自 Object 類別.

方法描述
ClearValue Clears the local value of a dependency property. (繼承自DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (繼承自DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (繼承自DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (繼承自DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (繼承自DependencyObject)

 

屬性

ContentThemeTransition類別 擁有這些屬性。

屬性存取類型描述

Dispatcher

唯讀Gets the CoreDispatcher that this object is associated with. (繼承自DependencyObject)

HorizontalOffset

讀取/寫入Gets or sets the distance by which the target is translated in the horizontal direction when the transition is active.

HorizontalOffsetProperty

唯讀Identifies the HorizontalOffset dependency property.

VerticalOffset

讀取/寫入Gets or sets the distance by which the target is translated in the vertical direction when the transition is active.

VerticalOffsetProperty

唯讀Identifies the VerticalOffset dependency property.

 

備註

請注意,設定 Duration 屬性對於這個物件沒有任何影響,因為持續期間已預先設定。

範例

下列範例會將 ContentThemeAnimation 套用至矩形。



<!-- The ContentThemeTransition will execute when the ContentControl’s content changes. -->        
<ContentControl x:Name="ContentHost" PointerPressed="ContentHost_PointerPressed">
    <ContentControl.ContentTransitions>
        <TransitionCollection>
            <ContentThemeTransition />
        </TransitionCollection>
    </ContentControl.ContentTransitions>
    <Rectangle Height="200" Width="200" Fill="Orange" />
</ContentControl>


private void ContentHost_PointerPressed(object sender, PointerRoutedEventArgs e)
{
    // Replace the ContentControl's content with a new Rectangle of a random color.
    Rectangle newItem = new Rectangle();
    Random rand = new Random();
            
    newItem.Height = 200;
    newItem.Width = 200;
    newItem.Fill = new SolidColorBrush(Color.FromArgb(255, 
         (byte)rand.Next(0, 255), (byte)rand.Next(0,255), (byte)rand.Next(0, 255)));

    ContentHost.Content = newItem; 
}

需求

支援的最小用戶端

Windows 8 [僅限 Windows 市集應用程式]

支援的最小伺服器

Windows Server 2012 [僅限 Windows 市集應用程式]

命名空間

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

請參閱

Transition
以動畫呈現內容轉換
內容轉換動畫的方針與檢查清單

 

 

顯示:
© 2014 Microsoft