KeySpline 類別

定義

這個類別可供曲線主要畫面格用來定義動畫進度。This class is used by a spline key frame to define animation progress.

public ref class KeySpline : System::Windows::Freezable, IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.KeySplineConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public class KeySpline : System.Windows.Freezable, IFormattable
type KeySpline = class
    inherit Freezable
    interface IFormattable
Public Class KeySpline
Inherits Freezable
Implements IFormattable
繼承
屬性
實作

備註

若要瞭解KeySpline運作方式, 瞭解三次方貝茲曲線會很有説明。To understand how a KeySpline works, it is helpful to understand cubic Bezier curves. 三次方貝茲曲線是由一個起始點、一個結束點和兩個控制點所定義。A cubic Bezier curve is defined by a start point, an end point, and two control points. 中的兩個座標KeySpline會定義這兩個控制點。The two coordinates in the KeySpline defines those two control points. 描述主要曲線時, 貝茲曲線的起點一律為 0, 而結束點一律為 1, 這就是為何只定義兩個控制點的原因。When describing key splines, the start point of the Bezier curve is always 0, and the end point is always 1, which is why you define only the two control points. 產生的曲線會指定在一段時間內, 動畫的插補方式。也就是說, 曲線代表在時間區段上, 動畫的目標屬性中的變更率。The resulting curve specifies how an animation is interpolated during a time segment; that is, the curve represents the rate of change in the animation's target attribute over the time segment. 若要更進一步查看動畫進度和貝茲曲線之間的關聯性, 請參閱主要曲線動畫範例To better see the relationship between animation progress and a Bezier curve, see Key Spline Animation Sample.

XAML Attribute UsageXAML Attribute Usage

<object property="cp1X,cp1Y cp2X,cp2Y"/>  

XAML 值XAML Values

cp1Xcp1X
X曲線第一個控制點的元件。X component of the curve's first control point. 值長度必須介於 0 到 1 之間。The value must be between 0 and 1.

cp1Ycp1Y
Y曲線第一個控制點的元件。Y component of the curve's first control point. 值長度必須介於 0 到 1 之間。The value must be between 0 and 1.

cp2Xcp2X
X曲線第二個控制點的元件。X component of the curve's second control point. 值長度必須介於 0 到 1 之間。The value must be between 0 and 1.

cp2Ycp2Y
Y曲線第二個控制點的元件。Y component of the curve's second control point. 值長度必須介於 0 到 1 之間。The value must be between 0 and 1.

值之間的分隔符號可以是逗號或一或多個空格。The separator between values may be either comma or one or more spaces. 在點的元件和點之間的空格之間, 以逗號顯示的慣例是建議的慣例。The convention shown here of commas between components of a point and space between points is a recommended convention. 請不要使用逗號做為點元件值內的小數點, 即使這是您文化特性中的標準也一樣。Do not use a comma as the decimal point within the values of point components, even if that is the norm in your culture. 在所有類型轉換案例中, XAML 值都會被視為 en-us, 因此逗號會被解讀為分隔符號, 而不是預期的小數點。XAML values are treated as en-us in all type conversion cases, and the comma is thus interpreted as the separator and not as the intended decimal point.

建構函式

KeySpline()

初始化 KeySpline 類別的新執行個體。Initializes a new instance of the KeySpline class.

KeySpline(Double, Double, Double, Double)

使用指定的控制點座標,初始化 KeySpline 類別的新執行個體。Initializes a new instance of the KeySpline class with the specified coordinates for the control points.

KeySpline(Point, Point)

使用指定的控制點,初始化 KeySpline 類別的新執行個體。Initializes a new instance of the KeySpline class with the specified control points.

屬性

CanFreeze

取得值,指出是否可以將物件設為不可修改。Gets a value that indicates whether the object can be made unmodifiable.

(繼承來源 Freezable)
ControlPoint1

用來定義描述 KeySpline 之貝茲曲線的第一個控制點。The first control point used to define a Bezier curve that describes a KeySpline.

ControlPoint2

用來定義描述 KeySpline 之貝茲曲線的第二個控制點。The second control point used to define a Bezier curve that describes a KeySpline.

DependencyObjectType

取得包裝此執行個體之 CLRCLR 型別的 DependencyObjectTypeGets the DependencyObjectType that wraps the CLRCLR type of this instance.

(繼承來源 DependencyObject)
Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)
IsFrozen

取得值,該值表示物件目前是否可修改。Gets a value that indicates whether the object is currently modifiable.

(繼承來源 Freezable)
IsSealed

取得值,這個值表示此執行個體目前是否已密封 (唯讀)。Gets a value that indicates whether this instance is currently sealed (read-only).

(繼承來源 DependencyObject)

方法

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)
ClearValue(DependencyProperty)

清除屬性的區域數值。Clears the local value of a property. 要清除的屬性是由 DependencyProperty 識別項所指定。The property to be cleared is specified by a DependencyProperty identifier.

(繼承來源 DependencyObject)
ClearValue(DependencyPropertyKey)

清除唯讀屬性的區域數值。Clears the local value of a read-only property. 要清除的屬性是由 DependencyPropertyKey 所指定。The property to be cleared is specified by a DependencyPropertyKey.

(繼承來源 DependencyObject)
Clone()

建立這個 Freezable 的可修改複製,製作這個物件值的深層複製。Creates a modifiable clone of the Freezable, making deep copies of the object's values. 當複製這個物件的相依性屬性時,這個方法會複製運算式 (但可能已不再解析),但不會複製動畫或其目前值。When copying the object's dependency properties, this method copies expressions (which might no longer resolve) but not animations or their current values.

(繼承來源 Freezable)
CloneCore(Freezable)

使這個執行個體成為指定之 KeySpline 的深層複本。Makes this instance a deep copy of the specified KeySpline. 當複製相依性屬性時,這個方法會複製資源參考和資料繫結 (但可能無法再解析),但不會複製動畫或它們目前的值。When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.

CloneCurrentValue()

使用 Freezable 的目前值,建立它的可修改複製品 (深層複本)。Creates a modifiable clone (deep copy) of the Freezable using its current values.

(繼承來源 Freezable)
CloneCurrentValueCore(Freezable)

使用目前的屬性值,讓這個執行個體成為指定之 KeySpline 的可修改深層複本。Makes this instance a modifiable deep copy of the specified KeySpline using current property values. 不會複製資源參考、資料繫結和動畫,但是會複製其目前值。Resource references, data bindings, and animations are not copied, but their current values are.

CoerceValue(DependencyProperty)

強制轉型所指定相依性屬性的值。Coerces the value of the specified dependency property. 完成方式是叫用存在於呼叫 DependencyObject 之相依性屬性的屬性中繼資料中所指定的任何 CoerceValueCallback 函式。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(繼承來源 DependencyObject)
CreateInstance()

初始化 Freezable 類別的新執行個體。Initializes a new instance of the Freezable class.

(繼承來源 Freezable)
CreateInstanceCore()

建立 KeySpline 的新執行個體。Creates a new instance of KeySpline.

Equals(Object)

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

(繼承來源 DependencyObject)
Freeze()

將目前的物件設為不可修改,並將其 IsFrozen 屬性設定為 trueMakes the current object unmodifiable and sets its IsFrozen property to true.

(繼承來源 Freezable)
FreezeCore(Boolean)

Freezable 物件設為不可修改的,或測試是否可以將它設為不可修改的。Makes the Freezable object unmodifiable or tests whether it can be made unmodifiable.

(繼承來源 Freezable)
GetAsFrozen()

使用基底 (非動畫) 屬性值,建立 Freezable 的凍結複本。Creates a frozen copy of the Freezable, using base (non-animated) property values. 因為複本已凍結,所以會以傳址方式複製任何凍結子物件。Because the copy is frozen, any frozen sub-objects are copied by reference.

(繼承來源 Freezable)
GetAsFrozenCore(Freezable)

使這個執行個體成為指定之 KeySpline 物件的複製。Makes this instance a clone of the specified KeySpline object.

GetCurrentValueAsFrozen()

使用目前屬性值,建立 Freezable 的凍結複本。Creates a frozen copy of the Freezable using current property values. 因為複本已凍結,所以會以傳址方式複製任何凍結子物件。Because the copy is frozen, any frozen sub-objects are copied by reference.

(繼承來源 Freezable)
GetCurrentValueAsFrozenCore(Freezable)

使這個執行個體成為所指定 KeySpline 的凍結複製品。Makes this instance a frozen clone of the specified KeySpline. 不會複製資源參考、資料繫結和動畫,但是會複製其目前值。Resource references, data bindings, and animations are not copied, but their current values are.

GetHashCode()

取得這個 DependencyObject 的雜湊碼。Gets a hash code for this DependencyObject.

(繼承來源 DependencyObject)
GetLocalValueEnumerator()

建立特定的列舉值,以判斷哪些相依性屬性在此 DependencyObject 上具有本機設定的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

(繼承來源 DependencyObject)
GetSplineProgress(Double)

從提供的線性級數計算曲線級數。Calculates spline progress from a supplied linear progress.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
GetValue(DependencyProperty)

傳回 DependencyObject 的這個執行個體上之相依性屬性的目前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject.

(繼承來源 DependencyObject)
InvalidateProperty(DependencyProperty)

重新評估指定相依性屬性的有效值。Re-evaluates the effective value for the specified dependency property.

(繼承來源 DependencyObject)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnChanged()

目前的 KeySpline 物件遭到修改時進行呼叫。Called when the current KeySpline object is modified.

OnFreezablePropertyChanged(DependencyObject, DependencyObject)

確定已為剛剛設定的 DependencyObjectType 資料成員,建立適當的內容指標。Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set.

(繼承來源 Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)

這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構,但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

(繼承來源 Freezable)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

覆寫 OnPropertyChanged(DependencyPropertyChangedEventArgs)DependencyObject 實作也可以叫用任何 Changed 處理常式,以回應類型 Freezable 的變更相依性屬性。Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable.

(繼承來源 Freezable)
ReadLocalValue(DependencyProperty)

傳回相依性屬性的區域值 (如果存在)。Returns the local value of a dependency property, if it exists.

(繼承來源 DependencyObject)
ReadPreamble()

確定 Freezable 是從有效的執行緒進行存取。Ensures that the Freezable is being accessed from a valid thread. 如果 API 會讀取非相依性屬性的資料成員,則 Freezable 的繼承者必須在該 API 的開頭呼叫這個方法。Inheritors of Freezable must call this method at the beginning of any API that reads data members that are not dependency properties.

(繼承來源 Freezable)
SetCurrentValue(DependencyProperty, Object)

設定相依性屬性的值,而不需要變更其值來源。Sets the value of a dependency property without changing its value source.

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

設定相依性屬性的區域值 (由相依性屬性的識別碼所指定)。Sets the local value of a dependency property, specified by its dependency property identifier.

(繼承來源 DependencyObject)
SetValue(DependencyPropertyKey, Object)

設定唯讀相依性屬性的區域數值 (由相依性屬性的 DependencyPropertyKey 識別項所指定)。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

(繼承來源 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

傳回值,這個值表示序列化程序是否應該序列化所提供相依性屬性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(繼承來源 DependencyObject)
ToString()

根據目前的文化特性 (Culture),建立這個 KeySpline 執行個體的字串表示。Creates a string representation of this instance of KeySpline based on the current culture.

ToString(IFormatProvider)

根據提供的 KeySpline 建立這個 IFormatProvider 的字串表示。Creates a string representation of this KeySpline based on the supplied IFormatProvider.

VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)
WritePostscript()

引發 FreezableChanged 事件,並叫用其 OnChanged() 方法。Raises the Changed event for the Freezable and invokes its OnChanged() method. 在任何 API 修改未以相依性屬性儲存的類別成員之後,衍生自 Freezable 的類別應該在 API 的結尾呼叫這個方法。Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties.

(繼承來源 Freezable)
WritePreamble()

確認 Freezable 未凍結,而且是從有效的執行緒內容進行存取。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. 在任何 API 將資料寫入至非相依性屬性的資料成員之前,Freezable 繼承者應該在 API 的開頭呼叫這個方法。Freezable inheritors should call this method at the beginning of any API that writes to data members that are not dependency properties.

(繼承來源 Freezable)

事件

Changed

發生於 Freezable 或所含的物件遭到修改時。Occurs when the Freezable or an object it contains is modified.

(繼承來源 Freezable)

明確介面實作

IFormattable.ToString(String, IFormatProvider)

使用指定的格式,格式化目前執行個體的值。Formats the value of the current instance using the specified format.

適用於

另請參閱