다음을 통해 공유


ComboBox.SelectionBoxItem 속성

정의

선택 상자에 표시되는 항목을 가져옵니다.

public:
 property System::Object ^ SelectionBoxItem { System::Object ^ get(); };
public object SelectionBoxItem { get; }
member this.SelectionBoxItem : obj
Public ReadOnly Property SelectionBoxItem As Object

속성 값

선택한 항목입니다.

예제

다음 예제에서는 속성에 Content a ContentPresenter 속성을 바인딩합니다 SelectionBoxItem . 는 ContentPresenter forComboBoxControlTemplate 일부입니다.

전체 샘플은 ControlTemplates 샘플을 사용한 스타일 지정을 참조하세요.

<ContentPresenter x:Name="ContentSite"
                  IsHitTestVisible="False"
                  Content="{TemplateBinding SelectionBoxItem}"
                  ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                  ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                  Margin="3,3,23,3"
                  VerticalAlignment="Stretch"
                  HorizontalAlignment="Left">
</ContentPresenter>

설명

ControlTemplateComboBox 속성을 사용하여 선택한 항목을 ComboBox표시합니다. 외부의 ComboBoxControlTemplate선택한 항목을 얻으려면 이 속성 대신 속성을 사용합니다 Selector.SelectedItem .

XAML 특성 사용

<object property="{TemplateBinding SelectionBoxItem}"/>

종속성 속성 정보

Item 가치
식별자 필드 SelectionBoxItemProperty
메타데이터 속성이 다음으로 설정됩니다. true 없음

적용 대상