Exemple #1
0
 public MainViewModel()
 {
     repository          = new CodesAccountingRepository();
     events              = new EventsAgregator();
     CodesViewModel      = new CodesViewModel(repository, events);
     TemplatesViewModel  = new TemplatesViewModel(repository);
     NavigationViewModel = new NavigationViewModel(repository, events);
 }
Exemple #2
0
        public NavigationViewModel(CodesAccountingRepository repository, EventsAgregator events)
        {
            this.events         = events;
            this.repository     = repository;
            NavigationTemplates = new ObservableCollection <Navigation>();

            TemplatesView         = CollectionViewSource.GetDefaultView(NavigationTemplates);
            TemplatesView.Filter += TemplatesFilter;

            LoadTemplatesAsync();
        }
Exemple #3
0
        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();
        }