0
的文本标签我有这样定义的按钮:如何更改工具栏按钮
<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="" />
</Style>
按钮的文本标签设置为“播放”。
有没有办法在代码中将文本标签动态更改为“停止”,或者我将不得不定义第二个按钮并在它们之间切换?
Thx
你会为按钮设置一个新的文本属性,即ButtonPlayMax.Text =“blah” –
我认为你需要在样式Play ...和Stop ..之间切换,不仅仅是文本。 –
我倾向于认为,当我尝试简单的解决方案时,需要在样式之间切换...... –