How can I do a similar operation in WPF?
class BooleanToContentConverter : IValueConverter
{
public string TrueContent { get; set; }
public string FalseContent { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool)value ? TrueContent : FalseContent;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
<Page.Resources>
<conv:BooleanToContentConverter x:Key="StateContent" TrueContent="Pause" FalseContent="Play"/>
</Page.Resources>
I haven't tried it this way, but the contents of all objects change at the same time.