コード例 #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;
        }
コード例 #2
0
        private void Load()
        {
            Persons = personsService.Get();

            SelectedPerson = Persons.FirstOrDefault();
        }
コード例 #3
0
 public Person Get(int id)
 {
     return(personsService.Get(id));
 }
コード例 #4
0
 private void Load()
 {
     Person = personsService.Get(100);
 }