Share via


TreeView.SelectionMode 屬性

定義

取得或設定 TreeView 實例的選取行為。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 property TreeViewSelectionMode SelectionMode { TreeViewSelectionMode get(); void set(TreeViewSelectionMode value); };
TreeViewSelectionMode SelectionMode();

void SelectionMode(TreeViewSelectionMode value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")]
TreeViewSelectionMode SelectionMode();

void SelectionMode(TreeViewSelectionMode value);
public TreeViewSelectionMode SelectionMode { get; set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")]
public TreeViewSelectionMode SelectionMode { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::TreeViewSelectionMode::Single")] set; }
Public Property SelectionMode As TreeViewSelectionMode

屬性值

列舉值,指定 TreeView的選取行為。 預設值為 [單一 選取專案]。

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

適用於