コード例 #1
0
        public PreferencesViewModel(Preferences model)
        {
            this.model = model;

            editing = new Preferences();
            model.CopyTo(editing);

            CommitCommand = new RelayCommand(o => Commit());
            CancelCommand = new RelayCommand(o => Cancel());
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: kennedykinyanjui/Projects
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Preferences = Preferences.LoadFrom(PreferencePath);

            var view = new MainWindow();
            MainWindow = view;

            var model = new MainViewModel();
            foreach (var product in Product.LoadFrom())
            {
                model.Products.Add(new ProductViewModel(product));
            }
            model.CloseRequired += delegate
            {
                view.Close();
            };

            view.DataContext = model;
            view.Show();
        }
コード例 #3
0
 public void CopyTo(Preferences dest)
 {
     dest.MatchingMode = MatchingMode;
 }