Here\'s the scenario. We use a large XML configuration file for one of our server products. This file is fairly well layed out and is validated against an XSD file.
It\'
To present simple xml configs (if custom editors for values are not required) one can directly bind XElement to a view using HierarchicalDataTemplate.
xaml:
view model:
class ConfigViewModel:INotifyPropertyChanged
{
public XElement Xml { get; private set;}
//example of persistence infrastructure
public event PropertyChangedEventHandler PropertyChanged = delegate { };
public void Load(string fileName)
{
Xml = XElement.Load(fileName);
PropertyChanged(this, new PropertyChangedEventArgs("Xml"));
}
public void Save(string fileName)
{
Xml.Save(fileName);
}
}
There are some good examples for reversed bool to visibility converter.