繁体   English   中英

如何更改工具栏按钮的文本标签

[英]How to change the text label of a toolbar button

我有一个这样定义的按钮:

        <Button x:Name="ButtonPlayMax"
            Click="ButtonPlayMax_Click"
            Style="{StaticResource PlayVideoAppBarButtonStyle}"
            HorizontalAlignment="Center"
            VerticalAlignment="Bottom"
            FontSize="17.333"
            Margin="0"/>

        <Style x:Key="PlayVideoAppBarButtonStyle"
           TargetType="ButtonBase"
           BasedOn="{StaticResource AppBarButtonStyle}">
           <Setter Property="AutomationProperties.AutomationId"
                Value="PlayVideoAppBarButton" />
           <Setter Property="AutomationProperties.Name"
                Value="Play" />
           <Setter Property="Content"
                Value="&#xE102;" />
        </Style>

按钮的文本标签设置为“播放”。

有没有一种方法可以将代码中的文本标签动态更改为“停止”,或者我必须定义第二个按钮并在它们之间切换?

谢谢

IL_Agent的答案是正确的。 我确实改变了风格。 两种样式的区别只是播放和停止所需的文本。 抱歉,请不要早日解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM