AppBarButton.LabelPosition 속성

정의

단추 레이블의 배치 및 표시 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property CommandBarLabelPosition LabelPosition { CommandBarLabelPosition get(); void set(CommandBarLabelPosition value); };
CommandBarLabelPosition LabelPosition();

void LabelPosition(CommandBarLabelPosition value);
public CommandBarLabelPosition LabelPosition { get; set; }
var commandBarLabelPosition = appBarButton.labelPosition;
appBarButton.labelPosition = commandBarLabelPosition;
Public Property LabelPosition As CommandBarLabelPosition
<AppBarButton LabelPosition="commandBarLabelPositionMemberName" />

속성 값

단추 레이블의 배치 및 표시 유형을 지정하는 열거형 값입니다. 기본값은 기본값입니다.

Windows 요구 사항

디바이스 패밀리
Windows 10 Anniversary Edition (10.0.14393.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v3.0에서 도입되었습니다.)

설명

기본적으로 앱 바 단추의 레이블은 CommandBar.DefaultLabelPosition 속성에 지정된 위치에 표시됩니다. LabelPosition 속성을 설정하여 이 값을 재정의하고 특정 앱 바 단추에 대해 레이블을 항상 축소할 수 있습니다.

버전 호환성

LabelPosition 속성은 Windows 10 버전 1607 이전에는 사용할 수 없습니다. Microsoft Visual Studio에서 앱의 '최소 플랫폼 버전' 설정이 이 페이지의 뒷부분에 있는 요구 사항 블록에 표시된 '도입된 버전'보다 작은 경우 이를 고려하여 앱을 디자인하고 테스트해야 합니다. 자세한 내용은 버전 적응 코드를 참조하세요.

앱이 이전 버전의 Windows 10 실행되는 경우 예외를 방지하려면 XAML에서 이 속성을 설정하거나 런타임 검사 수행하지 않고 사용하지 마세요. 이 예제에서는 ApiInformation 클래스를 사용하여 설정하기 전에 이 속성이 있는지 검사 방법을 보여줍니다.

<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
    <AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
</CommandBar>
private void CommandBar_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarButton", "LabelPosition"))
    {
        appBarButtonCut.LabelPosition = CommandBarLabelPosition.Collapsed;
    }
}

적용 대상