I would create a converter. If you add a converter whenever you have a corresponding binding problem like this, you will slowly create a library of them for your application, which will make things a lot easier for you in the future. I would call it something like NameFieldViewToVisibilityConverter - it should have two methods:
public Object Convert(Object value, Type TargetType, Object param, CultureInfo Culture); public Object ConvertBack(Object value, Type TargetType, Object param, CultureInfo Culture);
Convert will have a NameFieldView parameter and return a visibility value. ConvertBack will have the Visibility parameter and returns a NameFieldView value.
The binding will look like this:
<Grid Name="StandardView" Visibility="{Binding View, Converter={StaticResource NameFieldViewToVisibilityConverter}" />
Nathan kovner
source share