public PreferencesViewModel(Preferences model)
        {
            this.model = model;

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

            CommitCommand = new RelayCommand(o => Commit());
            CancelCommand = new RelayCommand(o => Cancel());
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 public void CopyTo(Preferences dest)
 {
     dest.MatchingMode = MatchingMode;
 }