I have a WrapPanel with 3 buttons.
<WrapPanel Orientation="Horizontal">
<Button Content="Book1" />
<Button Content="Book2" />
<Button Content="Book3" />
</WrapPanel>
If i click on Book1 i see the content for Book1. If i click on Book2 i see the content for Book2 etc. Is there any command that can strikethrough the button if i click on it? In Html there is “del” for text:
<del>Strikethrough</del>
I want same but in wpf and with Buttons
Thank you
Add TextDecoration object to TextBlock.TextDecorations collection in click event (for example):
XAML:
And handler:
UPDATE: answer for your comment – the simplest way
XAML
Code:
Note that this code is always assumes that a button content is a textblock. Just for simplicity.