Selector.IsSynchronizedWithCurrentItem 속성

정의

SelectorSelectedItemItems 속성의 현재 항목과 동기화된 상태로 유지하는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property Nullable<bool> IsSynchronizedWithCurrentItem { Nullable<bool> get(); void set(Nullable<bool> value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
public bool? IsSynchronizedWithCurrentItem { get; set; }
[System.ComponentModel.Bindable(true)]
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
[System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
public bool? IsSynchronizedWithCurrentItem { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>]
member this.IsSynchronizedWithCurrentItem : Nullable<bool> with get, set
[<System.ComponentModel.Bindable(true)>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>]
[<System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")>]
member this.IsSynchronizedWithCurrentItem : Nullable<bool> with get, set
Public Property IsSynchronizedWithCurrentItem As Nullable(Of Boolean)

속성 값

Nullable<Boolean>

SelectedItem이 항상 ItemCollection의 현재 항목과 동기화되면 true이고, SelectedItem이 현재 항목과 동기화되지 않으면 false이며, SelectedItemSelector를 사용하는 경우에만 CollectionView이 현재 항목과 동기화되면 null입니다. 기본값은 null입니다.

특성

예제

다음 예제에서는 두 컨트롤 ListBox 을 동일한 ItemsSource컨트롤에 바인딩합니다. IsSynchronizedWithCurrentItemListBox항목에 대해 true 설정되므로 선택한 항목은 두 컨트롤에 대해 항상 동일합니다.

<XmlDataProvider x:Key="Employees" XPath="/Employees/*">
  <x:XData>
    <Employees xmlns="">
      <Employee Name="Terry Adams" Type="FTE" EmployeeNumber="1" />
      <Employee Name="Claire O'Donnell" Type="FTE" EmployeeNumber="12345" />
      <Employee Name="Palle Peterson" Type="FTE" EmployeeNumber="5678" />
      <Employee Name="Amy E. Alberts" Type="CSG" EmployeeNumber="99222" />
      <Employee Name="Stefan Hesse" Type="Vendor" EmployeeNumber="-" />
    </Employees>
  </x:XData>
</XmlDataProvider>

<DataTemplate x:Key="EmployeeItemTemplate">
  <TextBlock Text="{Binding XPath=@Name}" />
</DataTemplate>
<ListBox Name="employeeListBox1"
         ItemsSource="{Binding Source={StaticResource Employees}}"
         ItemTemplate="{StaticResource EmployeeItemTemplate}"
         IsSynchronizedWithCurrentItem="True"/>

<ListBox Name="employeeListBox2"
         ItemsSource="{Binding Source={StaticResource Employees}}"
         ItemTemplate="{StaticResource EmployeeItemTemplate}"
         IsSynchronizedWithCurrentItem="True"/>

설명

선택한 항목이 IsSynchronizedWithCurrentItem 항상 .의 속성 true 에 해당하도록 속성을 ItemCollection설정할 수 있습니다CurrentItem. 예를 들어 해당 속성이 동일한 원본으로 ItemsSource 설정된 두 개의 ListBox 컨트롤이 있다고 가정합니다. IsSynchronizedWithCurrentItem true 두 목록 상자에서 각각 ListBox 선택한 항목이 동일한지 확인합니다.

XAML 특성 사용

<개체 IsSynchronizedWithCurrentItem ="Boolean"/>

또는

<개체 IsSynchronizedWithCurrentItem ="{}"/>

종속성 속성 정보

식별자 필드 IsSynchronizedWithCurrentItemProperty
메타 데이터 속성 설정 true 없음

적용 대상