Share via


ConnectedAnimationService.PrepareToAnimate(String, UIElement) 方法

定義

傳回與指定之索引鍵和來源專案相關聯的連接動畫。

public:
 virtual ConnectedAnimation ^ PrepareToAnimate(Platform::String ^ key, UIElement ^ source) = PrepareToAnimate;
ConnectedAnimation PrepareToAnimate(winrt::hstring const& key, UIElement const& source);
public ConnectedAnimation PrepareToAnimate(string key, UIElement source);
function prepareToAnimate(key, source)
Public Function PrepareToAnimate (key As String, source As UIElement) As ConnectedAnimation

參數

key
String

Platform::String

winrt::hstring

動畫的索引鍵。

source
UIElement

從檢視產生動畫效果的專案。

傳回

具有指定索引鍵的動畫。

備註

當您呼叫 PrepareToAnimate 時,您會提供與 方法所傳回之新建立 ConnectedAnimation 相關聯的金鑰。 您稍後可以呼叫 GetAnimation來使用此金鑰來擷取相同的動畫。 這可讓您在兩個不同的頁面之間連接動畫,而不需要在頁面之間手動傳遞 ConnectedAnimation 物件的參考。

適用於