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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間