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; }
private void Load() { Persons = personsService.Get(); SelectedPerson = Persons.FirstOrDefault(); }
public Person Get(int id) { return(personsService.Get(id)); }
private void Load() { Person = personsService.Get(100); }