I have buttoncontent named Hold button. Once when I clicked button the button content should change to Resume, again if pressed resume button means Hold should be visible.
XAML code:
<Button Style="{StaticResource CommonButtonStyle}" Template="{DynamicResource GlassButton}" ToolTip="F9" Click="Hold_Click" PreviewKeyDown="Hold_PreviewKeyDown" Name="OK" Margin="1,49,25,0" Grid.Column="2" Grid.Row="13" Grid.RowSpan="2">
<StackPanel Style="{StaticResource ButtonStackPanel}">
<Image Style="{StaticResource CancelImages}" />
<TextBlock Text="{Loc lblHold}" Style="{StaticResource ButtonTextBlock}" />
</StackPanel>
</Button>
You can try something like this in the button's Click
event:
private void holdResumeButton_Click(object sender, RoutedEventArgs e)
{
if ((string)holdResumeButton.Content == "Hold")
holdResumeButton.Content = "Resume";
else
holdResumeButton.Content = "Hold";
}
XAML:
<Button x:Name="holdResumeButton"
Content="Hold"
Click="holdResumeButton_Click"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With