Beispiel #1
0
        public virtual void SetSettings(SIEESettings s)
        {
            settings = s;

            SIEEViewModel vmCommon = factory.CreateViewModel(settings);

            wpfControl.SetDataContext(vmCommon);
            vmCommon.Initialize(wpfControl);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 public void SetDataContext(SIEEViewModel viewModel)
 {
     DataContext       = viewModel;
     viewModel.Control = this;
 }
Beispiel #4
0
 public SIEETreeView(SIEEViewModel vm)
 {
     this.Vm = vm;
 }