Selector.IsSynchronizedWithCurrentItem 屬性

定義

取得或設定值,這個值表示 選取器 是否應該讓 SelectedItemItems 屬性中的目前專案保持同步。

public:
 property IReference<bool> ^ IsSynchronizedWithCurrentItem { IReference<bool> ^ get(); void set(IReference<bool> ^ value); };
IReference<bool> IsSynchronizedWithCurrentItem();

void IsSynchronizedWithCurrentItem(IReference<bool> value);
public System.Nullable<bool> IsSynchronizedWithCurrentItem { get; set; }
var iReference = selector.isSynchronizedWithCurrentItem;
selector.isSynchronizedWithCurrentItem = iReference;
Public Property IsSynchronizedWithCurrentItem As Nullable(Of Boolean)
<selector IsSynchronizedWithCurrentItem="bool"/>
- or -
<selector IsSynchronizedWithCurrentItem="{x:Null}"/>

屬性值

如果 SelectedItem 一律與 ItemCollection 中的目前專案同步,則為 true;如果SelectedItem 永遠不會與目前專案同步,則為 false;如果 SelectedItem 只有在選取器使用 ICollectionView 時,才會與目前專案同步處理,則為 null。 預設值為 null/不確定。

如果您使用 C#或 Microsoft Visual Basic 進行程式設計,此屬性的類型會投影為 bool? (可為 Null 的 布爾 值) 。

備註

IsSynchronizedWithCurrentItem 的可為 Null 值可讓值不定,不具 truefalse。 如果是在程式代碼中存取,則此值會以 null 表示。 若要在 XAML 中將值設定為 null ,請使用 {x:Null} 標記延伸

選取行為和 CollectionViewSource

衍生自 Selector 的清單控制項具有預設選取行為,取決於專案來源 (ItemsSource) 所使用的類型。 如果專案來源是 CollectionViewSource 實例,則選取控件的行為是選取範圍預設為目前專案。 第一次顯示清單時,選取範圍預設為第一個專案做為目前專案。 如果您不想在此案例中選取第一個專案,請在 GridViewListView 或其他顯示選取項目的選取器型控件中,將 IsSynchronizedWithCurrentItem 設定為 false

適用於

另請參閱