protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var dbRepos = new DbRepos(); Resources["MainWindowViewModel"] = new MainWindowViewModel(dbRepos); }
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(); }