O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding with a value converter

In the previous recipes, you learned how to adjust the user interface based on the values of properties defined within the view model class. However, you could ask yourself these simple questions: What should I do to show or hide some elements using the data binding mechanism?  Do I need to define a separate property of the Visibility type for each element with such a feature? Of course, you could solve this problem in the mentioned way. However, there is a much better approach available if you use value converters. They allow you to convert a particular value into another. For instance, you can define a value converter that could convert a Boolean value into the Visibility enumeration value. You will learn how to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required