public ConfigurationModel() { OptionsModel = new MainViewModel(); OptionsModel.AppModel = this; RenderingModel = new RenderingSets(this); LicenceModel = new LicenceViewModel(); LicenceModel.AppModel = this; Instance = this; }
public RenderingSetsWindow(IntPtr hwndOwner, string setName, bool canApply) { _startingSet = setName; _hwndOwner = hwndOwner; _sets = new RenderingSets(null); DataContext = _sets; InitializeComponent(); var targetSet = _sets.Sets.Where(set => set.Name == setName).FirstOrDefault(); if (targetSet == null) targetSet = _sets.Sets.Where(set => string.Compare(set.Name, setName, true) == 0).FirstOrDefault(); if (targetSet != null) _sets.SelectedSet = targetSet; btnApply.Visibility = canApply ? Visibility.Visible : Visibility.Collapsed; _customRenderingSetApplied = false; DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(RenderingSets.SelectedSetProperty, typeof(RenderingSets)); descriptor.AddValueChanged(_sets, new EventHandler(SelectedSetChanged)); }
private void Window_Closed(object sender, EventArgs e) { _sets.Dispose(); _sets = null; }