How Do I Have an Editor Depend on Another Property?

Sometimes the behavior of an editor might depend on the value a property other than the one being edited. For example:

To access another property from a property editor data template, use the UnderlyingObject binding. For example:

CopyUsing UnderlyingObject
<DataTemplate x:Key="ReticulationStyleEditor">
  <TextBox Text="{Binding Value}" 
           IsEnabled="{Binding UnderlyingObject.IsSpline}" />

<DataTemplate x:Key="CarModelEditor">
  <ComboBox SelectedValue="{Binding Value}" 
            ItemsSource="{Binding UnderlyingObject.Make, Converter={StaticResource GetModelsFromMake}}" />

Bindings to UnderlyingObject properties can be two-way, meaning you can create a single editor UI that modifies multiple properties. However you should be cautious about doing this because the “other” properties will still have entries in the property grid unless you hide them.