Skip to content

How to use a converter

Grega Mohorko edited this page Feb 1, 2018 · 1 revision

You must add a reference to the Converters namespace: xmlns:converters="clr-namespace:GM.WPF.Converters;assembly=GM.WPF".

Then you can simply use all of the converters: {Binding Converter={converters:MyConverter}}.


An example of using the ObjectToVisibilityConverter with the Collapse parameter:

<StackPanel Visibility="{Binding MyViewModelProperty, Converter={converters:ObjectToVisibilityConverter}, ConverterParameter=Collapse}">
    <!-- The content -->
</StackPanel>
Clone this wiki locally