Posted 16 years ago
by Derek Smithson
-
Software Developer,
Vista Systems, Corp.
It doesn't look like the PropertyGrid's SelectedObject can be bound to an object using a path expression; is this intentional or is the way I'm binding fundamentally incorrect? This is the same binding syntax I was using previously with the Mindscape grid previously:
In the XAML snippet above, appState is defined in the Window resources, and is a class implementing INotifyPropertyChanged (shown below).
<propGrid:PropertyGrid SelectedObject="{Binding Source={StaticResource appState}, Path=SelectedObject}"/>
public class ApplicationState : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private object selectedObject;
public object SelectedObject
{
get { return selectedObject; }
set
{
if (selectedObject != value)
{
selectedObject = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("SelectedObject"));
}
}
}
}