Beispiel #1
0
 /// <summary>
 /// Load from xml
 /// </summary>
 public void LoadFromXml(VariableContainerXml xml)
 {
     ObservableCollection<VariableGroup> groups = new ObservableCollection<VariableGroup>();
     foreach (VariableGroupXml group in xml.Groups)
     {
         VariableGroup varGroup = new VariableGroup();
         varGroup.LoadFromXml(group);
         groups.Add(varGroup);
     }
     AddDefaultGroups(groups);
     Groups = groups;
 }
 protected void SetModel(object sender, DependencyPropertyChangedEventArgs e)
 {
     _model = DataContext as VariableGroup;
     if (_model == null) return;
 }
 public VariableGroupEditor()
 {
     InitializeComponent();
     this.DataContextChanged += SetModel;
     _model = this.DataContext as VariableGroup;
 }