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 ..之間切換,不僅僅是文本。 –
我傾向於認爲,當我嘗試簡單的解決方案時,需要在樣式之間切換...... –