Esempio n. 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            var dbRepos = new DbRepos();

            Resources["MainWindowViewModel"] = new MainWindowViewModel(dbRepos);
        }
Esempio n. 2
0
        public MainWindowViewModel(DbRepos dbRepos)
        {
            this.dbRepos = dbRepos;

            NewElementCommand       = new RelayCommand(p => NewElementAction());
            CopyToNewElementCommand = new RelayCommand(p => CopyToNewElementAction());
            DeleteElementCommand    = new RelayCommand(p => DeleteElementAction());
            SaveElementCommand      = new RelayCommand(p => SaveElementAction());
            QuantityIncCommand      = new RelayCommand(p => QuantityIncAction());
            QuantityDecCommand      = new RelayCommand(p => QuantityDecAction());

            elements = dbRepos.GetAllElementsShort();
            NewElementAction();
        }