共用方式為


Selection.PrimarySelection 屬性

取得主要選擇物件。

命名空間:  Microsoft.Windows.Design.Interaction
組件:  Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)

語法

'宣告
Public ReadOnly Property PrimarySelection As ModelItem
    Get
public ModelItem PrimarySelection { get; }
public:
property ModelItem^ PrimarySelection {
    ModelItem^ get ();
}
member PrimarySelection : ModelItem
function get PrimarySelection () : ModelItem

屬性值

型別:Microsoft.Windows.Design.Model.ModelItem
如果選取範圍包含物件則傳回主要選擇物件,否則為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

當在設計工具中選取了多個物件時,有一個物件會是「主要選取物件」(Primary Selection Object)。 主要選取物件通常用來做為其他行為的索引鍵。 例如,若要將所有選取的物件靠左邊對齊,主要選取物件就會決定對齊物件的位置。

.NET Framework 安全性

請參閱

參考

Selection 類別

Microsoft.Windows.Design.Interaction 命名空間

SelectionCommands

SelectionOperations

SelectionTool

EditingContext

其他資源

WPF 設計工具擴充性架構