I need exactly was is solved in this question, unfortunately it is for Silverlight and I was not able to make that "Interactivity" libraries to work.
I have a ToggleButton
and I want to change the Content
property to "Hello" when it's checked "Good bye" when it's unchecked. Changing it manually is not an option for me in this case, as the change of the state can be done from multiple sources.
I think that an Converter might be needed for this task, and I've seen converters to Visibility but not to string.
EDIT: I've thought about putting both words in a stackpanel and switch the visibility Visible/Collapsed bound to the state:
<ToggleButton.Content>
<StackPanel>
<TextBlock Text="Hello" Visibility="{Binding ...}"/>
<TextBlock Text="GoodBye"/>
</StackPanel>
</ToggleButton.Content>