public virtual void SetSettings(SIEESettings s) { settings = s; SIEEViewModel vmCommon = factory.CreateViewModel(settings); wpfControl.SetDataContext(vmCommon); vmCommon.Initialize(wpfControl); }
public void SetDefaults(Type settingsType, SIEEViewModel vm) { foreach (KeyValuePair <string, string> propSetting in defaultSettings.GetPropertiesDict(settingsType.Name)) { string propName = propSetting.Key; string propValue = propSetting.Value; SIEEDefaultValues.ObjectAndPropertyInfo opi = SIEEDefaultValues.FindProperty(vm, propName.Split('.')); if (opi.PropertyInfo == null) { continue; } var newValue = Convert.ChangeType(propValue, opi.PropertyInfo.PropertyType); opi.PropertyInfo.SetValue(opi.Object, newValue, null); } }
public void SetDataContext(SIEEViewModel viewModel) { DataContext = viewModel; viewModel.Control = this; }
public SIEETreeView(SIEEViewModel vm) { this.Vm = vm; }