Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1196 lines (1100 sloc) 79.5 KB
<Type Name="Selector" FullName="System.Windows.Controls.Primitives.Selector">
<TypeSignature Language="C#" Value="public abstract class Selector : System.Windows.Controls.ItemsControl" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract Selector extends System.Windows.Controls.ItemsControl" />
<TypeSignature Language="DocId" Value="T:System.Windows.Controls.Primitives.Selector" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class Selector&#xA;Inherits ItemsControl" />
<TypeSignature Language="C++ CLI" Value="public ref class Selector abstract : System::Windows::Controls::ItemsControl" />
<TypeSignature Language="F#" Value="type Selector = class&#xA; inherit ItemsControl" />
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Controls.ItemsControl</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("SelectionChanged")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("SelectedIndex")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a control that allows a user to select items from among its child elements.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Windows.Controls.Primitives.Selector> is an <xref:System.Windows.Controls.ItemsControl>, which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the <xref:System.Windows.Controls.ItemsControl> class.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected Selector ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; Selector();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Controls.Primitives.Selector" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AddSelectedHandler">
<MemberSignature Language="C#" Value="public static void AddSelectedHandler (System.Windows.DependencyObject element, System.Windows.RoutedEventHandler handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void AddSelectedHandler(class System.Windows.DependencyObject element, class System.Windows.RoutedEventHandler handler) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.AddSelectedHandler(System.Windows.DependencyObject,System.Windows.RoutedEventHandler)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub AddSelectedHandler (element As DependencyObject, handler As RoutedEventHandler)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void AddSelectedHandler(System::Windows::DependencyObject ^ element, System::Windows::RoutedEventHandler ^ handler);" />
<MemberSignature Language="F#" Value="static member AddSelectedHandler : System.Windows.DependencyObject * System.Windows.RoutedEventHandler -&gt; unit" Usage="System.Windows.Controls.Primitives.Selector.AddSelectedHandler (element, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="handler" Type="System.Windows.RoutedEventHandler" />
</Parameters>
<Docs>
<param name="element">Element that listens to this event.</param>
<param name="handler">Event handler to add.</param>
<summary>Adds a handler for the <see cref="E:System.Windows.Controls.Primitives.Selector.Selected" /> attached event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AddUnselectedHandler">
<MemberSignature Language="C#" Value="public static void AddUnselectedHandler (System.Windows.DependencyObject element, System.Windows.RoutedEventHandler handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void AddUnselectedHandler(class System.Windows.DependencyObject element, class System.Windows.RoutedEventHandler handler) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.AddUnselectedHandler(System.Windows.DependencyObject,System.Windows.RoutedEventHandler)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub AddUnselectedHandler (element As DependencyObject, handler As RoutedEventHandler)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void AddUnselectedHandler(System::Windows::DependencyObject ^ element, System::Windows::RoutedEventHandler ^ handler);" />
<MemberSignature Language="F#" Value="static member AddUnselectedHandler : System.Windows.DependencyObject * System.Windows.RoutedEventHandler -&gt; unit" Usage="System.Windows.Controls.Primitives.Selector.AddUnselectedHandler (element, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="handler" Type="System.Windows.RoutedEventHandler" />
</Parameters>
<Docs>
<param name="element">Element that listens to this event.</param>
<param name="handler">Event handler to add.</param>
<summary>Adds a handler for the <see cref="E:System.Windows.Controls.Primitives.Selector.Unselected" /> attached event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ClearContainerForItemOverride">
<MemberSignature Language="C#" Value="protected override void ClearContainerForItemOverride (System.Windows.DependencyObject element, object item);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void ClearContainerForItemOverride(class System.Windows.DependencyObject element, object item) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.ClearContainerForItemOverride(System.Windows.DependencyObject,System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub ClearContainerForItemOverride (element As DependencyObject, item As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void ClearContainerForItemOverride(System::Windows::DependencyObject ^ element, System::Object ^ item);" />
<MemberSignature Language="F#" Value="override this.ClearContainerForItemOverride : System.Windows.DependencyObject * obj -&gt; unit" Usage="selector.ClearContainerForItemOverride (element, item)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="item" Type="System.Object" />
</Parameters>
<Docs>
<param name="element">The item container element.</param>
<param name="item">The data item.</param>
<summary>Returns an item container to the state it was in before <see cref="M:System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object)" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Windows.Controls.Primitives.Selector.ClearContainerForItemOverride%2A> clears the <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType> attached property when the item container is removed from the visual tree. This is done so item containers behave correctly when the <xref:System.Windows.Controls.Primitives.Selector> uses container recycling. For more information, see <xref:System.Windows.Controls.VirtualizationMode> and "Container Recycling" in [Optimizing Performance: Controls](~/docs/framework/wpf/advanced/optimizing-performance-controls.md).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetIsSelected">
<MemberSignature Language="C#" Value="public static bool GetIsSelected (System.Windows.DependencyObject element);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsSelected(class System.Windows.DependencyObject element) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.GetIsSelected(System.Windows.DependencyObject)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function GetIsSelected (element As DependencyObject) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool GetIsSelected(System::Windows::DependencyObject ^ element);" />
<MemberSignature Language="F#" Value="static member GetIsSelected : System.Windows.DependencyObject -&gt; bool" Usage="System.Windows.Controls.Primitives.Selector.GetIsSelected element" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Windows.AttachedPropertyBrowsableForChildren</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
</Parameters>
<Docs>
<param name="element">Object to query concerning the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSelected" /> property.</param>
<summary>Gets the value of the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSelected" /> attached property that indicates whether an item is selected.</summary>
<returns>Boolean value, <see langword="true" /> if the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSelected" /> property is <see langword="true" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetIsSelectionActive">
<MemberSignature Language="C#" Value="public static bool GetIsSelectionActive (System.Windows.DependencyObject element);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsSelectionActive(class System.Windows.DependencyObject element) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.GetIsSelectionActive(System.Windows.DependencyObject)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function GetIsSelectionActive (element As DependencyObject) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool GetIsSelectionActive(System::Windows::DependencyObject ^ element);" />
<MemberSignature Language="F#" Value="static member GetIsSelectionActive : System.Windows.DependencyObject -&gt; bool" Usage="System.Windows.Controls.Primitives.Selector.GetIsSelectionActive element" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
</Parameters>
<Docs>
<param name="element">The element from which to read the attached property.</param>
<summary>Gets a value that indicates whether the keyboard focus is within the <see cref="T:System.Windows.Controls.Primitives.Selector" /></summary>
<returns>Value of the property, <see langword="true" /> if the keyboard focus is within the <see cref="T:System.Windows.Controls.Primitives.Selector" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsSelected">
<MemberSignature Language="C#" Value="see GetIsSelected, and SetIsSelected" />
<MemberSignature Language="ILAsm" Value="see GetIsSelected, and SetIsSelected" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.IsSelected" />
<MemberSignature Language="VB.NET" Value="see GetIsSelected, and SetIsSelected" />
<MemberSignature Language="F#" Value="see GetIsSelected, and SetIsSelected" Usage="see GetIsSelected, and SetIsSelected" />
<MemberType>AttachedProperty</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets or sets a value that indicates whether an item is selected.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A> attached property to select an item in the <xref:System.Windows.Controls.Primitives.Selector> when you do not explicitly create the item container. An item container is a class that represents an item in the <xref:System.Windows.Controls.Primitives.Selector>. <xref:System.Windows.Controls.TabItem>, <xref:System.Windows.Controls.ListBoxItem>, and <xref:System.Windows.Controls.ComboBoxItem> are item containers for the controls that inherit from <xref:System.Windows.Controls.Primitives.Selector>, and each defines an **IsSelected** property.
If you do not explicitly create an item container, [!INCLUDE[TLA#tla_winclient](~/includes/tlasharptla-winclient-md.md)] implicitly creates one and sets the **IsSelected** property on the item container to the value of <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType>. This is the only time <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType> is read. <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType> is not updated if the selection on the item changes.
If you explicitly create an item container, you should use the **IsSelected** property on that class.
<a name="dependencyPropertyInfo_IsSelected"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.IsSelectedProperty>, registered as Attached|
|Metadata properties set to `true`|<xref:System.Windows.FrameworkPropertyMetadata.BindsTwoWayByDefault%2A>|
## Examples
The follow example creates a <xref:System.Windows.Controls.ListBox> that contains two <xref:System.Windows.Controls.CheckBox> controls. The example does not explicitly create a <xref:System.Windows.Controls.ListBoxItem> for either <xref:System.Windows.Controls.CheckBox>, so it sets <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType> directly on each <xref:System.Windows.Controls.CheckBox>. To illustrate that <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType> is not updated, the example binds the <xref:System.Windows.Controls.Primitives.ToggleButton.IsChecked%2A> property of the first checkbox to <xref:System.Windows.Controls.Primitives.Selector.IsSelected%2A?displayProperty=nameWithType>. When the user unselects the item in the <xref:System.Windows.Controls.ListBox>, the <xref:System.Windows.Controls.CheckBox> remains checked. Likewise, checking or unchecking the <xref:System.Windows.Controls.CheckBox> does not affect whether the <xref:System.Windows.Controls.CheckBox> is selected in the <xref:System.Windows.Controls.ListBox>. The example binds <xref:System.Windows.Controls.Primitives.ToggleButton.IsChecked%2A> of the second <xref:System.Windows.Controls.CheckBox> to <xref:System.Windows.Controls.ListBoxItem.IsSelected%2A?displayProperty=nameWithType>. In this case, unselecting the item in the <xref:System.Windows.Controls.ListBox> causes the checkbox to be unchecked, and unchecking the checkbox also unselects the item.
```xaml
<ListBox Name="listBox1" SelectionMode="Multiple">
<CheckBox Selector.IsSelected="True"
IsChecked="{Binding RelativeSource={RelativeSource Self},
Path=(Selector.IsSelected), Mode=TwoWay}">
CheckBox.IsChecked is bound to Selector.IsChecked, which is set only
once.
</CheckBox>
<CheckBox ListBox.IsSelected="True"
IsChecked="{Binding RelativeSource={RelativeSource
AncestorType={x:Type ListBoxItem}},
Path=IsSelected, Mode=TwoWay}">
CheckBox.IsChecked is bound to ListBoxItem.IsChecked, which is
updated throughout the duration of the application.
</CheckBox>
</ListBox>
```
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsSelectedProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty IsSelectedProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty IsSelectedProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.IsSelectedProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly IsSelectedProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ IsSelectedProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable IsSelectedProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.IsSelectedProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSelected" /> attached property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsSelectionActive">
<MemberSignature Language="C#" Value="see GetIsSelectionActive" />
<MemberSignature Language="ILAsm" Value="see GetIsSelectionActive" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.IsSelectionActive" />
<MemberSignature Language="VB.NET" Value="see GetIsSelectionActive" />
<MemberSignature Language="F#" Value="see GetIsSelectionActive" Usage="see GetIsSelectionActive" />
<MemberType>AttachedProperty</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets a value that indicates whether the keyboard focus is within the value returned by a <see cref="T:System.Windows.Controls.Primitives.Selector" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is a rare case of a read-only attached property. You cannot set it in XAML; it exists so that you can check its value on selected items in code.
<a name="dependencyPropertyInfo_IsSelectionActive"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.IsSelectionActiveProperty>|
|Metadata properties set to `true`|<xref:System.Windows.FrameworkPropertyMetadata.Inherits%2A>|
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsSelectionActiveProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty IsSelectionActiveProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty IsSelectionActiveProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.IsSelectionActiveProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly IsSelectionActiveProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ IsSelectionActiveProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable IsSelectionActiveProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.IsSelectionActiveProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSelectionActive" /> attached property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsSynchronizedWithCurrentItem">
<MemberSignature Language="C#" Value="public Nullable&lt;bool&gt; IsSynchronizedWithCurrentItem { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;bool&gt; IsSynchronizedWithCurrentItem" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem" />
<MemberSignature Language="VB.NET" Value="Public Property IsSynchronizedWithCurrentItem As Nullable(Of Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Nullable&lt;bool&gt; IsSynchronizedWithCurrentItem { Nullable&lt;bool&gt; get(); void set(Nullable&lt;bool&gt; value); };" />
<MemberSignature Language="F#" Value="member this.IsSynchronizedWithCurrentItem : Nullable&lt;bool&gt; with get, set" Usage="System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Category("Behavior")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.TypeConverter("System.Windows.NullableBoolConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Boolean&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether a <see cref="T:System.Windows.Controls.Primitives.Selector" /> should keep the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" /> synchronized with the current item in the <see cref="P:System.Windows.Controls.ItemsControl.Items" /> property.</summary>
<value>
<see langword="true" /> if the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" /> is always synchronized with the current item in the <see cref="T:System.Windows.Controls.ItemCollection" />; <see langword="false" /> if the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" /> is never synchronized with the current item; <see langword="null" /> if the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" /> is synchronized with the current item only if the <see cref="T:System.Windows.Controls.Primitives.Selector" /> uses a <see cref="T:System.Windows.Data.CollectionView" />. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can set the <xref:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem%2A> property to `true` to ensure that the item selected always corresponds to the <xref:System.Windows.Controls.ItemCollection.CurrentItem%2A> property in the <xref:System.Windows.Controls.ItemCollection>. For example, suppose that there are two <xref:System.Windows.Controls.ListBox> controls with their <xref:System.Windows.Controls.ItemsControl.ItemsSource%2A> property set to the same source. Set <xref:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem%2A> to `true` on both list boxes to ensure that the selected item in each <xref:System.Windows.Controls.ListBox> is the same.
<a name="xamlAttributeUsage_IsSynchronizedWithCurrentItem"></a>
## XAML Attribute Usage
<*object* `IsSynchronizedWithCurrentItem`="<xref:System.Boolean>"/>
-or-
<*object* `IsSynchronizedWithCurrentItem`="{}"/>
<a name="dependencyPropertyInfo_IsSynchronizedWithCurrentItem"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItemProperty>|
|Metadata properties set to `true`|None|
## Examples
The following example binds two <xref:System.Windows.Controls.ListBox> controls to the same <xref:System.Windows.Controls.ItemsControl.ItemsSource%2A>. Because <xref:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem%2A> is set to `true` on each <xref:System.Windows.Controls.ListBox>, the selected item is always the same for both controls
[!code-xaml[Selector#2](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#2)]
[!code-xaml[Selector#4](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#4)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsSynchronizedWithCurrentItemProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty IsSynchronizedWithCurrentItemProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty IsSynchronizedWithCurrentItemProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItemProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly IsSynchronizedWithCurrentItemProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ IsSynchronizedWithCurrentItemProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable IsSynchronizedWithCurrentItemProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItemProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.IsSynchronizedWithCurrentItem" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnInitialized">
<MemberSignature Language="C#" Value="protected override void OnInitialized (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnInitialized(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.OnInitialized(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnInitialized (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnInitialized(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnInitialized : EventArgs -&gt; unit" Usage="selector.OnInitialized e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" Index="0" FrameworkAlternate="netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.RoutedEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.FrameworkElement.Initialized" /> event. This method is invoked whenever <see cref="P:System.Windows.FrameworkElement.IsInitialized" /> is set to <see langword="true" /> internally.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnIsKeyboardFocusWithinChanged">
<MemberSignature Language="C#" Value="protected override void OnIsKeyboardFocusWithinChanged (System.Windows.DependencyPropertyChangedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnIsKeyboardFocusWithinChanged(valuetype System.Windows.DependencyPropertyChangedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.OnIsKeyboardFocusWithinChanged(System.Windows.DependencyPropertyChangedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnIsKeyboardFocusWithinChanged (e As DependencyPropertyChangedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnIsKeyboardFocusWithinChanged(System::Windows::DependencyPropertyChangedEventArgs e);" />
<MemberSignature Language="F#" Value="override this.OnIsKeyboardFocusWithinChanged : System.Windows.DependencyPropertyChangedEventArgs -&gt; unit" Usage="selector.OnIsKeyboardFocusWithinChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.DependencyPropertyChangedEventArgs" />
</Parameters>
<Docs>
<param name="e">The event data.</param>
<summary>Called when the <see cref="P:System.Windows.UIElement.IsKeyboardFocusWithin" /> property has changed.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnItemsChanged">
<MemberSignature Language="C#" Value="protected override void OnItemsChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnItemsChanged(class System.Collections.Specialized.NotifyCollectionChangedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnItemsChanged (e As NotifyCollectionChangedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnItemsChanged(System::Collections::Specialized::NotifyCollectionChangedEventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnItemsChanged : System.Collections.Specialized.NotifyCollectionChangedEventArgs -&gt; unit" Usage="selector.OnItemsChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Collections.Specialized.NotifyCollectionChangedEventArgs" />
</Parameters>
<Docs>
<param name="e">The event data.</param>
<summary>Updates the current selection when an item in the <see cref="T:System.Windows.Controls.Primitives.Selector" /> has changed</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnItemsSourceChanged">
<MemberSignature Language="C#" Value="protected override void OnItemsSourceChanged (System.Collections.IEnumerable oldValue, System.Collections.IEnumerable newValue);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnItemsSourceChanged(class System.Collections.IEnumerable oldValue, class System.Collections.IEnumerable newValue) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.OnItemsSourceChanged(System.Collections.IEnumerable,System.Collections.IEnumerable)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnItemsSourceChanged (oldValue As IEnumerable, newValue As IEnumerable)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnItemsSourceChanged(System::Collections::IEnumerable ^ oldValue, System::Collections::IEnumerable ^ newValue);" />
<MemberSignature Language="F#" Value="override this.OnItemsSourceChanged : System.Collections.IEnumerable * System.Collections.IEnumerable -&gt; unit" Usage="selector.OnItemsSourceChanged (oldValue, newValue)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="oldValue" Type="System.Collections.IEnumerable" />
<Parameter Name="newValue" Type="System.Collections.IEnumerable" />
</Parameters>
<Docs>
<param name="oldValue">Old value of the source.</param>
<param name="newValue">New value of the source.</param>
<summary>Called when the source of an item in a selector changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnSelectionChanged">
<MemberSignature Language="C#" Value="protected virtual void OnSelectionChanged (System.Windows.Controls.SelectionChangedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnSelectionChanged(class System.Windows.Controls.SelectionChangedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.OnSelectionChanged(System.Windows.Controls.SelectionChangedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnSelectionChanged (e As SelectionChangedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnSelectionChanged(System::Windows::Controls::SelectionChangedEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnSelectionChanged : System.Windows.Controls.SelectionChangedEventArgs -&gt; unit&#xA;override this.OnSelectionChanged : System.Windows.Controls.SelectionChangedEventArgs -&gt; unit" Usage="selector.OnSelectionChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Controls.SelectionChangedEventArgs" />
</Parameters>
<Docs>
<param name="e">The event data.</param>
<summary>Called when the selection changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PrepareContainerForItemOverride">
<MemberSignature Language="C#" Value="protected override void PrepareContainerForItemOverride (System.Windows.DependencyObject element, object item);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void PrepareContainerForItemOverride(class System.Windows.DependencyObject element, object item) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub PrepareContainerForItemOverride (element As DependencyObject, item As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void PrepareContainerForItemOverride(System::Windows::DependencyObject ^ element, System::Object ^ item);" />
<MemberSignature Language="F#" Value="override this.PrepareContainerForItemOverride : System.Windows.DependencyObject * obj -&gt; unit" Usage="selector.PrepareContainerForItemOverride (element, item)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" Index="0" FrameworkAlternate="netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="item" Type="System.Object" Index="1" FrameworkAlternate="netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="element">The element that is used to display the specified item.</param>
<param name="item">The specified item to display.</param>
<summary>Prepares the specified element to display the specified item.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RemoveSelectedHandler">
<MemberSignature Language="C#" Value="public static void RemoveSelectedHandler (System.Windows.DependencyObject element, System.Windows.RoutedEventHandler handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveSelectedHandler(class System.Windows.DependencyObject element, class System.Windows.RoutedEventHandler handler) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.RemoveSelectedHandler(System.Windows.DependencyObject,System.Windows.RoutedEventHandler)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub RemoveSelectedHandler (element As DependencyObject, handler As RoutedEventHandler)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void RemoveSelectedHandler(System::Windows::DependencyObject ^ element, System::Windows::RoutedEventHandler ^ handler);" />
<MemberSignature Language="F#" Value="static member RemoveSelectedHandler : System.Windows.DependencyObject * System.Windows.RoutedEventHandler -&gt; unit" Usage="System.Windows.Controls.Primitives.Selector.RemoveSelectedHandler (element, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="handler" Type="System.Windows.RoutedEventHandler" />
</Parameters>
<Docs>
<param name="element">Element that listens to this event.</param>
<param name="handler">Event handler to remove.</param>
<summary>Removes a handler for the <see cref="E:System.Windows.Controls.Primitives.Selector.Selected" /> attached event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RemoveUnselectedHandler">
<MemberSignature Language="C#" Value="public static void RemoveUnselectedHandler (System.Windows.DependencyObject element, System.Windows.RoutedEventHandler handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveUnselectedHandler(class System.Windows.DependencyObject element, class System.Windows.RoutedEventHandler handler) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.RemoveUnselectedHandler(System.Windows.DependencyObject,System.Windows.RoutedEventHandler)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub RemoveUnselectedHandler (element As DependencyObject, handler As RoutedEventHandler)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void RemoveUnselectedHandler(System::Windows::DependencyObject ^ element, System::Windows::RoutedEventHandler ^ handler);" />
<MemberSignature Language="F#" Value="static member RemoveUnselectedHandler : System.Windows.DependencyObject * System.Windows.RoutedEventHandler -&gt; unit" Usage="System.Windows.Controls.Primitives.Selector.RemoveUnselectedHandler (element, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="handler" Type="System.Windows.RoutedEventHandler" />
</Parameters>
<Docs>
<param name="element">Element that listens to this event.</param>
<param name="handler">Event handler to remove.</param>
<summary>Removes a handler for the <see cref="E:System.Windows.Controls.Primitives.Selector.Unselected" /> attached event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Selected">
<MemberSignature Language="C#" Value="see AddSelectedHandler, and RemoveSelectedHandler" />
<MemberSignature Language="ILAsm" Value="see AddSelectedHandler, and RemoveSelectedHandler" />
<MemberSignature Language="DocId" Value="E:System.Windows.Controls.Primitives.Selector.Selected" />
<MemberSignature Language="VB.NET" Value="see AddSelectedHandler, and RemoveSelectedHandler" />
<MemberSignature Language="F#" Value="see AddSelectedHandler, and RemoveSelectedHandler" Usage="see AddSelectedHandler, and RemoveSelectedHandler" />
<MemberType>AttachedEvent</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Occurs when an item is selected.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<a name="routedEventInfo_Selected"></a>
## Routed Event Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectedEvent>|
|Routing strategy|Bubbling|
|Delegate|<xref:System.Windows.RoutedEventHandler>|
## Examples
The following examples show how to use the <xref:System.Windows.Controls.Primitives.Selector.Selected> event with a <xref:System.Windows.Controls.ListBox> control. The first example raises the event and the second shows how to handle the event.
[!code-xml[ListBoxItems_snip#SelectorEvents](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml#selectorevents)]
[!code-csharp[ListBoxItems_snip#SelectorSelected](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml.cs#selectorselected)]
[!code-vb[ListBoxItems_snip#SelectorSelected](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ListBoxItems_snip/visualbasic/window1.xaml.vb#selectorselected)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SelectedEvent">
<MemberSignature Language="C#" Value="public static readonly System.Windows.RoutedEvent SelectedEvent;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.RoutedEvent SelectedEvent" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectedEvent" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectedEvent As RoutedEvent " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::RoutedEvent ^ SelectedEvent;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectedEvent : System.Windows.RoutedEvent" Usage="System.Windows.Controls.Primitives.Selector.SelectedEvent" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.RoutedEvent</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="E:System.Windows.Controls.Primitives.Selector.Selected" /> routed event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectedIndex">
<MemberSignature Language="C#" Value="public int SelectedIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 SelectedIndex" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.SelectedIndex" />
<MemberSignature Language="VB.NET" Value="Public Property SelectedIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int SelectedIndex { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.SelectedIndex : int with get, set" Usage="System.Windows.Controls.Primitives.Selector.SelectedIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Category("Appearance")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the index of the first item in the current selection or returns negative one (-1) if the selection is empty.</summary>
<value>The index of first item in the current selection. The default value is negative one (-1).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a <xref:System.Windows.Controls.Primitives.Selector> supports selecting a single item, the <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> property returns the index of the selected item. If a <xref:System.Windows.Controls.Primitives.Selector> supports multiple selections, <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> returns the index of the item that the user selected first.
Setting <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> in a <xref:System.Windows.Controls.Primitives.Selector> that supports multiple selections clears existing selected items and sets the selection to the item specified by the index. <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> returns -1 if selection is empty.
If you set <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> to a value less that -1, an <xref:System.ArgumentException> is thrown. If you set <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> to a value equal or greater than the number of child elements, the value is ignored.
<a name="dependencyPropertyInfo_SelectedIndex"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectedIndexProperty>|
|Metadata properties set to `true`|<xref:System.Windows.FrameworkPropertyMetadata.BindsTwoWayByDefault%2A>, <xref:System.Windows.FrameworkPropertyMetadata.Journal%2A>|
## Examples
The following example creates a <xref:System.Windows.Controls.ListBox> and sets the <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> property to 1, which selects the second item in the <xref:System.Windows.Controls.ListBox>.
[!code-xaml[ListBoxItems_snip#2](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml#2)]
The following example uses the <xref:System.Windows.Controls.Primitives.Selector.SelectedIndex%2A> property to determine whether the item at index 0 is the first item in the selection.
[!code-csharp[ListBoxItems_snip#SelectorSelectedIndex](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml.cs#selectorselectedindex)]
[!code-vb[ListBoxItems_snip#SelectorSelectedIndex](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ListBoxItems_snip/visualbasic/window1.xaml.vb#selectorselectedindex)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SelectedIndexProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty SelectedIndexProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty SelectedIndexProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectedIndexProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectedIndexProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ SelectedIndexProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectedIndexProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.SelectedIndexProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedIndex" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectedItem">
<MemberSignature Language="C#" Value="public object SelectedItem { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object SelectedItem" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.SelectedItem" />
<MemberSignature Language="VB.NET" Value="Public Property SelectedItem As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ SelectedItem { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.SelectedItem : obj with get, set" Usage="System.Windows.Controls.Primitives.Selector.SelectedItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Category("Appearance")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the first item in the current selection or returns null if the selection is empty</summary>
<value>The first item in the current selection or <see langword="null" /> if the selection is empty.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a <xref:System.Windows.Controls.Primitives.Selector> supports selecting a single item, the <xref:System.Windows.Controls.Primitives.Selector.SelectedItem%2A> property returns the selected item. If a <xref:System.Windows.Controls.Primitives.Selector> supports multiple selections, <xref:System.Windows.Controls.Primitives.Selector.SelectedItem%2A> returns the item that the user selected first.
Setting <xref:System.Windows.Controls.Primitives.Selector.SelectedItem%2A> in a <xref:System.Windows.Controls.Primitives.Selector> that supports multiple selections clears existing selected items and sets the selection to the item specified.
<a name="dependencyPropertyInfo_SelectedItem"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectedItemProperty>|
|Metadata properties set to `true`|<xref:System.Windows.FrameworkPropertyMetadata.BindsTwoWayByDefault%2A>, <xref:System.Windows.FrameworkPropertyMetadata.Journal%2A>|
## Examples
The following example gets the <xref:System.Windows.Controls.Primitives.Selector.SelectedItem%2A> from a <xref:System.Windows.Controls.ListBox>.
[!code-csharp[ListBoxEvent#2](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxEvent/CSharp/Pane1.xaml.cs#2)]
[!code-vb[ListBoxEvent#2](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ListBoxEvent/VisualBasic/Pane1.xaml.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SelectedItemProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty SelectedItemProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty SelectedItemProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectedItemProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectedItemProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ SelectedItemProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectedItemProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.SelectedItemProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectedValue">
<MemberSignature Language="C#" Value="public object SelectedValue { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object SelectedValue" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.SelectedValue" />
<MemberSignature Language="VB.NET" Value="Public Property SelectedValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ SelectedValue { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.SelectedValue : obj with get, set" Usage="System.Windows.Controls.Primitives.Selector.SelectedValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Category("Appearance")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" />, obtained by using <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedValuePath" />.</summary>
<value>The value of the selected item.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Controls.Primitives.Selector.SelectedValuePath%2A> property specifies the path to the property that is used to determine the value of the <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> property. Setting <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> to a value X attempts to select an item whose value evaluates to X; if no such item can be found, the selection is cleared.
<a name="dependencyPropertyInfo_SelectedValue"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectedValueProperty>|
|Metadata properties set to `true`|<xref:System.Windows.FrameworkPropertyMetadata.BindsTwoWayByDefault%2A>, <xref:System.Windows.FrameworkPropertyMetadata.Journal%2A>|
## Examples
The following example binds a <xref:System.Windows.Controls.ListBox> to a collection of `Employee` objects. The example sets <xref:System.Windows.Controls.Primitives.Selector.SelectedValuePath%2A> to `@EmployeeNumber` and <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> to `12345`. This selects the `Employee` that has `12345` as the value of `EmployeeNumber`. This example also binds a <xref:System.Windows.Controls.TextBlock> to the <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> of the <xref:System.Windows.Controls.ListBox>. When the user changes the selection in the <xref:System.Windows.Controls.ListBox>, the <xref:System.Windows.Controls.TextBlock> is updated to show the employee number of the currently selected employee.
[!code-xaml[Selector#2](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#2)]
[!code-xaml[Selector#3](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#3)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Data.XmlDataProvider" />
</Docs>
</Member>
<Member MemberName="SelectedValuePath">
<MemberSignature Language="C#" Value="public string SelectedValuePath { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string SelectedValuePath" />
<MemberSignature Language="DocId" Value="P:System.Windows.Controls.Primitives.Selector.SelectedValuePath" />
<MemberSignature Language="VB.NET" Value="Public Property SelectedValuePath As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ SelectedValuePath { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.SelectedValuePath : string with get, set" Usage="System.Windows.Controls.Primitives.Selector.SelectedValuePath" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Bindable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Category("Appearance")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the path that is used to get the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedValue" /> from the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedItem" />.</summary>
<value>The path used to get the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedValue" />. The default is an empty string.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Controls.Primitives.Selector.SelectedValuePath%2A> property specifies the path to the property that is used to determine the value of the <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> property.
<a name="dependencyPropertyInfo_SelectedValuePath"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectedValuePathProperty>|
|Metadata properties set to `true`|None|
## Examples
The following example binds a <xref:System.Windows.Controls.ListBox> to a collection of `Employee` objects. The example sets <xref:System.Windows.Controls.Primitives.Selector.SelectedValuePath%2A> to `@EmployeeNumber` and <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> to `12345`. This selects the `Employee` that has `12345` as the value of `EmployeeNumber`. This example also binds a <xref:System.Windows.Controls.TextBlock> to the <xref:System.Windows.Controls.Primitives.Selector.SelectedValue%2A> of the <xref:System.Windows.Controls.ListBox>. When the user changes the selection in the <xref:System.Windows.Controls.ListBox>, the <xref:System.Windows.Controls.TextBlock> is updated to show the employee number of the currently selected employee.
[!code-xaml[Selector#2](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#2)]
[!code-xaml[Selector#3](~/samples/snippets/csharp/VS_Snippets_Wpf/Selector/CS/Window1.xaml#3)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Data.XmlDataProvider" />
</Docs>
</Member>
<Member MemberName="SelectedValuePathProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty SelectedValuePathProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty SelectedValuePathProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectedValuePathProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectedValuePathProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ SelectedValuePathProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectedValuePathProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.SelectedValuePathProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedValuePath" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectedValueProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty SelectedValueProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty SelectedValueProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectedValueProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectedValueProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ SelectedValueProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectedValueProperty : System.Windows.DependencyProperty" Usage="System.Windows.Controls.Primitives.Selector.SelectedValueProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Controls.Primitives.Selector.SelectedValue" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectionChanged">
<MemberSignature Language="C#" Value="public event System.Windows.Controls.SelectionChangedEventHandler SelectionChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Controls.SelectionChangedEventHandler SelectionChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Controls.Primitives.Selector.SelectionChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event SelectionChanged As SelectionChangedEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Controls::SelectionChangedEventHandler ^ SelectionChanged;" />
<MemberSignature Language="F#" Value="member this.SelectionChanged : System.Windows.Controls.SelectionChangedEventHandler " Usage="member this.SelectionChanged : System.Windows.Controls.SelectionChangedEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Behavior")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Controls.SelectionChangedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the selection of a <see cref="T:System.Windows.Controls.Primitives.Selector" /> changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event occurs whenever there is a change to a selection. A selection can be changed not only by user interaction but also by binding as well as other set values.
<a name="routedEventInfo_SelectionChanged"></a>
## Routed Event Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.SelectionChangedEvent>|
|Routing strategy|Bubbling|
|Delegate|<xref:System.Windows.Controls.SelectionChangedEventHandler>|
## Examples
The following example shows how to attach the <xref:System.Windows.Controls.Primitives.Selector.SelectionChanged> event to a list box control.
[!code-xaml[ListBoxEvent#1](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxEvent/CSharp/Pane1.xaml#1)]
The following example shows how to handle the <xref:System.Windows.Controls.Primitives.Selector.SelectionChanged> event.
[!code-csharp[ListBoxEvent#2](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxEvent/CSharp/Pane1.xaml.cs#2)]
[!code-vb[ListBoxEvent#2](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ListBoxEvent/VisualBasic/Pane1.xaml.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SelectionChangedEvent">
<MemberSignature Language="C#" Value="public static readonly System.Windows.RoutedEvent SelectionChangedEvent;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.RoutedEvent SelectionChangedEvent" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.SelectionChangedEvent" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SelectionChangedEvent As RoutedEvent " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::RoutedEvent ^ SelectionChangedEvent;" />
<MemberSignature Language="F#" Value=" staticval mutable SelectionChangedEvent : System.Windows.RoutedEvent" Usage="System.Windows.Controls.Primitives.Selector.SelectionChangedEvent" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.RoutedEvent</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="E:System.Windows.Controls.Primitives.Selector.SelectionChanged" /> routed event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SetIsSelected">
<MemberSignature Language="C#" Value="public static void SetIsSelected (System.Windows.DependencyObject element, bool isSelected);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetIsSelected(class System.Windows.DependencyObject element, bool isSelected) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.Primitives.Selector.SetIsSelected(System.Windows.DependencyObject,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub SetIsSelected (element As DependencyObject, isSelected As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void SetIsSelected(System::Windows::DependencyObject ^ element, bool isSelected);" />
<MemberSignature Language="F#" Value="static member SetIsSelected : System.Windows.DependencyObject * bool -&gt; unit" Usage="System.Windows.Controls.Primitives.Selector.SetIsSelected (element, isSelected)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="element" Type="System.Windows.DependencyObject" />
<Parameter Name="isSelected" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="element">Object on which to set the property.</param>
<param name="isSelected">Value to set.</param>
<summary>Sets a property value that indicates whether an item in a <see cref="T:System.Windows.Controls.Primitives.Selector" /> is selected.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Unselected">
<MemberSignature Language="C#" Value="see AddUnselectedHandler, and RemoveUnselectedHandler" />
<MemberSignature Language="ILAsm" Value="see AddUnselectedHandler, and RemoveUnselectedHandler" />
<MemberSignature Language="DocId" Value="E:System.Windows.Controls.Primitives.Selector.Unselected" />
<MemberSignature Language="VB.NET" Value="see AddUnselectedHandler, and RemoveUnselectedHandler" />
<MemberSignature Language="F#" Value="see AddUnselectedHandler, and RemoveUnselectedHandler" Usage="see AddUnselectedHandler, and RemoveUnselectedHandler" />
<MemberType>AttachedEvent</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Occurs when an item is unselected.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<a name="routedEventInfo_Unselected"></a>
## Routed Event Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.Primitives.Selector.UnselectedEvent>|
|Routing strategy|Bubbling|
|Delegate|<xref:System.Windows.RoutedEventHandler>|
## Examples
The following examples show how to use the <xref:System.Windows.Controls.Primitives.Selector.Unselected> event with a <xref:System.Windows.Controls.ListBox> control and how to create an event handler.
[!code-xml[ListBoxItems_snip#SelectorEvents](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml#selectorevents)]
[!code-csharp[ListBoxItems_snip#SelectorUnselected](~/samples/snippets/csharp/VS_Snippets_Wpf/ListBoxItems_snip/CSharp/Window1.xaml.cs#selectorunselected)]
[!code-vb[ListBoxItems_snip#SelectorUnselected](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ListBoxItems_snip/visualbasic/window1.xaml.vb#selectorunselected)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="UnselectedEvent">
<MemberSignature Language="C#" Value="public static readonly System.Windows.RoutedEvent UnselectedEvent;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.RoutedEvent UnselectedEvent" />
<MemberSignature Language="DocId" Value="F:System.Windows.Controls.Primitives.Selector.UnselectedEvent" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly UnselectedEvent As RoutedEvent " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::RoutedEvent ^ UnselectedEvent;" />
<MemberSignature Language="F#" Value=" staticval mutable UnselectedEvent : System.Windows.RoutedEvent" Usage="System.Windows.Controls.Primitives.Selector.UnselectedEvent" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.RoutedEvent</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="E:System.Windows.Controls.Primitives.Selector.Unselected" /> routed event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.