Ejemplo n.º 1
0
        public PersonsPageViewModel(IPersonsService personsService, IDialogHost dialogHost)
        {
            _personsService = personsService;
            _dialogHost     = dialogHost;

            Persons = new ObservableCollection <Person>(_personsService.Get());


            PersonsViews        = (CollectionView)CollectionViewSource.GetDefaultView(Persons);
            PersonsViews.Filter = PersonsFilter;

            FilteredFields = new Dictionary <string, string>(Person.Fields)
            {
                { AnyFieldFilterValue, "Любое поле" }
            };
            SelectedFilterField = AnyFieldFilterValue;
            IsContainsFilter    = true;

            SortedFields = new Dictionary <string, string>(Person.Fields)
            {
                { NoSortingSortValue, "Не сортировать" }
            };
            SelectedSortField = NoSortingSortValue;
            IsAscendingSort   = true;
        }
Ejemplo n.º 2
0
        private void Load()
        {
            Persons = personsService.Get();

            SelectedPerson = Persons.FirstOrDefault();
        }
Ejemplo n.º 3
0
 public Person Get(int id)
 {
     return(personsService.Get(id));
 }
Ejemplo n.º 4
0
 private void Load()
 {
     Person = personsService.Get(100);
 }