Manipulation.AddManipulator(UIElement, IManipulator) 方法

定義

IManipulator 物件與指定的項目產生關聯。Associates a IManipulator object with the specified element.

public:
 static void AddManipulator(System::Windows::UIElement ^ element, System::Windows::Input::IManipulator ^ manipulator);
public static void AddManipulator (System.Windows.UIElement element, System.Windows.Input.IManipulator manipulator);
static member AddManipulator : System.Windows.UIElement * System.Windows.Input.IManipulator -> unit
Public Shared Sub AddManipulator (element As UIElement, manipulator As IManipulator)

參數

element
UIElement

要與操作產生關聯的項目。The element to associate the manipulator with.

manipulator
IManipulator

物件,這個物件提供會建立操作或加入至操作之輸入的位置。The object that provides the position of the input that creates or is added to a manipulation.

例外狀況

elementnullelement is null.

-或--or- manipulatornullmanipulator is null.

項目上的 IsManipulationEnabled 屬性為 falseThe IsManipulationEnabled property on element is false.

備註

如果element已經有相關聯的操作, 會manipulator加入現有的操作中。If element already has a manipulation associated with it, manipulator is added to the existing manipulation. 否則, 會建立新的操作。Otherwise, a new manipulation is created.

適用於