コード例 #1
0
        public ConfigurationModel()
        {
            OptionsModel = new MainViewModel();
            OptionsModel.AppModel = this;

            RenderingModel = new RenderingSets(this);
			LicenceModel = new LicenceViewModel();
			LicenceModel.AppModel = this;
            Instance = this;
        }
コード例 #2
0
		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)); 
		}
コード例 #3
0
		private void Window_Closed(object sender, EventArgs e)
		{
			_sets.Dispose();
			_sets = null;
		}