public CustomerListViewModel(IDataService dataService, IUserSession userSession) { _badlist = new List <ServerResponse>(); _dataService = dataService; _userSession = userSession; Customers = new ObservableCollection <CustomerListItemViewModel>(); SelectedCustomerListItems = new ObservableCollection <CustomerListItemViewModel>(); SelectedCustomerListItems.CollectionChanged += SelectedCustomerListItemsChanged_EventHandler; _filter = new Filter(); InternalCommands.InvoiceSelected.RegisterCommand(new DelegateCommand <InvoiceListItemView>(RefreshInvoice)); InternalCommands.RefreshCustomers.RegisterCommand(new DelegateCommand(RefreshCustomers)); InternalCommands.UpdateInvoiceList.RegisterCommand(new DelegateCommand(UpdateInvoiceListFromSelectedCustomer)); InternalCommands.InvoiceIDSelected.RegisterCommand(new DelegateCommand(InvoiceIDSelected)); InternalCommands.ReloadInvoiceSearchFilter.RegisterCommand(new DelegateCommand(LoadAllInvoices)); ApplyFilterCommand = new DelegateCommand <object>(ExecuteApplyFilter); ResetFilterCommand = new DelegateCommand <object>(ExecuteResetFilter); AutoGenerateCommand = new DelegateCommand <object>(ExecuteAutoGenerate, CanExecuteAutoGenerate); FinalizeDraftCommand = new DelegateCommand <object>(ExecuteFinalizeDraftCommand, CanExecuteFinalizeDraftCommand); //LoadCustomerViews(); InternalCommands.ReloadInvoiceSearchFilter.Execute(null); EndDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddDays(-1); SelectedInvoice = new InvoiceListItemView(); }
public ShellViewModel(IUnityContainer unityContainer) { _unityContainer = unityContainer; MenuViewModel = unityContainer.Resolve <IMenuViewModel>(); ApplicationCommands.GoToLogin.RegisterCommand(new DelegateCommand <IMenuInfo>(OpenLoginWindow)); ApplicationCommands.SystemBusy.RegisterCommand(new DelegateCommand <string>(ExecuteSystemBusy)); ApplicationCommands.SystemIdle.RegisterCommand(new DelegateCommand(ExecuteSystemIdle)); VersionData = new DelegateCommand <object>(executeVersionData); }