I have a bool property in my ViewModel called IsConnected and I would like to bind it to a TextBlock in my MainWindow. Rather than have the textblock read true or false I need it to say Connected or Disconnected instead. Forgive me because I’m new to WPF. If someone could give me a head start I can take it from there but I’m not sure how to figure out what I need.
I have a bool property in my ViewModel called IsConnected and I would like
Share
I’d generally prefer to just add a property to the view model (I really dislike value converters), but here’s a simple way to accomplish what you’re trying to do using a style:
Edit
Note that once you get used to using data triggers, you can make all kinds of modifications to your view without touching your view model. For instance: