public MainViewModel() { repository = new CodesAccountingRepository(); events = new EventsAgregator(); CodesViewModel = new CodesViewModel(repository, events); TemplatesViewModel = new TemplatesViewModel(repository); NavigationViewModel = new NavigationViewModel(repository, events); }
public NavigationViewModel(CodesAccountingRepository repository, EventsAgregator events) { this.events = events; this.repository = repository; NavigationTemplates = new ObservableCollection <Navigation>(); TemplatesView = CollectionViewSource.GetDefaultView(NavigationTemplates); TemplatesView.Filter += TemplatesFilter; LoadTemplatesAsync(); }
public CodesViewModel(CodesAccountingRepository repository, EventsAgregator events) { events.SelectedTemplateIsChanged += SelectedTemplateIsChanged; this.repository = repository; Codes = new ObservableCollection <Codes>(); CodesView = CollectionViewSource.GetDefaultView(Codes); //CodesView.Filter += CodesFilter; AddCodesCommand = new DelegateCommand(AddCodes); ExportCodesCommand = new DelegateCommand(ExportCodes); FindCommand = new DelegateCommand(FindButton); UnblockCommand = new DelegateCommand(Unblock); LoadCodesAsync(); FindButton(); }