Selector.IsSynchronizedWithCurrentItem 속성

정의

SelectorSelectedItemItems 속성의 현재 항목과 동기화된 상태로 유지하는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value that indicates whether a Selector should keep the SelectedItem synchronized with the current item in the Items property.

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=4.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)]
public bool? IsSynchronizedWithCurrentItem { get; set; }
[System.ComponentModel.Bindable(true)]
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
[System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=3.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=4.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)>]
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=3.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입니다.true if the SelectedItem is always synchronized with the current item in the ItemCollection; false if the SelectedItem is never synchronized with the current item; null if the SelectedItem is synchronized with the current item only if the Selector uses a CollectionView. 기본값은 null입니다.The default value is null.

특성

예제

다음 예제에서는 두 ListBox 컨트롤을 동일한에 바인딩합니다 ItemsSource .The following example binds two ListBox controls to the same ItemsSource. IsSynchronizedWithCurrentItem는 각각에 대해로 설정 되므로 true ListBox 선택 된 항목은 두 컨트롤에 대해 항상 동일 합니다.Because IsSynchronizedWithCurrentItem is set to true on each ListBox, the selected item is always the same for both controls

<XmlDataProvider x:Key="Employees" XPath="/Employees/*">
  <x:XData>
    <Employees xmlns="">
      <Employee Name="Terry Adams" Type="FTE" EmployeeNumber="1" />
      <Employee Name="Claire O&apos;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 선택한 항목이 항상의 속성과 일치 하는지 확인할 수 있습니다 CurrentItem ItemCollection .You can set the IsSynchronizedWithCurrentItem property to true to ensure that the item selected always corresponds to the CurrentItem property in the ItemCollection. 예를 들어 ListBox 속성이 동일한 소스로 설정 된 두 개의 컨트롤이 있다고 가정 ItemsSource 합니다.For example, suppose that there are two ListBox controls with their ItemsSource property set to the same source. IsSynchronizedWithCurrentItem true 두 목록 상자에서 각각의 선택 된 항목이 동일한 지 확인 하려면를로 설정 ListBox 합니다.Set IsSynchronizedWithCurrentItem to true on both list boxes to ensure that the selected item in each ListBox is the same.

XAML 특성 사용XAML Attribute Usage

<개체 IsSynchronizedWithCurrentItem = " Boolean "/><object IsSynchronizedWithCurrentItem="Boolean"/>

또는-or-

<개체 IsSynchronizedWithCurrentItem = " {} "/><object IsSynchronizedWithCurrentItem="{}"/>

종속성 속성 정보Dependency Property Information

식별자 필드Identifier field IsSynchronizedWithCurrentItemProperty
메타 데이터 속성 설정 trueMetadata properties set to true 없음None

적용 대상