CommandBar.DefaultLabelPosition プロパティ

定義

コマンド バーのボタンのラベルの配置と表示を示す値を取得または設定します。

public:
 property CommandBarDefaultLabelPosition DefaultLabelPosition { CommandBarDefaultLabelPosition get(); void set(CommandBarDefaultLabelPosition value); };
CommandBarDefaultLabelPosition DefaultLabelPosition();

void DefaultLabelPosition(CommandBarDefaultLabelPosition value);
public CommandBarDefaultLabelPosition DefaultLabelPosition { get; set; }
var commandBarDefaultLabelPosition = commandBar.defaultLabelPosition;
commandBar.defaultLabelPosition = commandBarDefaultLabelPosition;
Public Property DefaultLabelPosition As CommandBarDefaultLabelPosition
<CommandBar DefaultLabelPosition="commandBarDefaultLabelPositionMemberName" />

プロパティ値

コマンド バーのボタンのラベルの配置と表示を示す列挙値。 既定値は Bottom です

注釈

既定では、アプリ バー ボタンのラベルがアイコンの下に表示されます。 このプロパティを設定すると、アイコンの右側にラベルを表示したり、ラベルを非表示にしたりできます。

AppBarButton.LabelPosition プロパティを設定してこの値をオーバーライドし、特定のアプリ バー ボタンのラベルを常に折りたたむことができます。

バージョンの互換性

DefaultLabelPosition プロパティは、バージョン 1607 より前Windows 10使用できません。 Microsoft Visual Studio のアプリの "最小プラットフォーム バージョン" 設定が、このページの後半の 「要件」 ブロックに示されている "導入されたバージョン" より小さい場合は、これを考慮してアプリを設計してテストする必要があります。 詳細については、「 バージョン アダプティブ コード」を参照してください。

アプリを以前のバージョンのWindows 10で実行するときに例外を回避するには、XAML でこのプロパティを設定したり、ランタイム チェックを実行せずに使用したりしないでください。 この例では、ApiInformation クラスを使用して、設定する前にこのプロパティの存在をチェックする方法を示します。

<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
    ...
</CommandBar>
private void CommandBar_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.CommandBar", "DefaultLabelPosition"))
    {
        commandBar1.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right;
    }
}

適用対象