public NextPageCommand(PaginationViewModel viewModel) { this.viewModel = viewModel; }
public SearchById(PaginationViewModel paging, EmpFormViewModel model) { this.paging = paging; this.model = model; }
public SearchCondition(PaginationViewModel paging, EmpFormViewModel model) { srchById = new SearchById(paging, model); srchByName = new SearchByName(paging, model); pagingCondition = new PagingCondition(paging, model); }
public PreviousPageCommand(PaginationViewModel viewModel) { this.viewModel = viewModel; }
public EmpViewModel() { EmpList = EmpService.GetEmpList(); Paging = new PaginationViewModel { PeopleList = _empList, }; Paging.ViewList.Filter += ViewList_Filter; ImportCommand = new RelayCommand(() => { IsImportDataVisible = true; IsSearchVisible = false; }, () => true); SearchCommand = new RelayCommand(() => { IsImportDataVisible = false; IsSearchVisible = true; EmpFormViewModel = new EmpFormViewModel(); }, () => true); NavigateToForm = new RelayCommand<dynamic>(vm => { this.IsImportDataVisible = false; this.IsSearchVisible = true; if (vm != null) EmpFormViewModel = vm; }); SortCommand1 = new RelayCommand<dynamic>(item => { if (string.Equals(item, "Name", StringComparison.InvariantCultureIgnoreCase)) { if (SortColumn.NameSortOrder == SortDir.Descending) { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); SortColumn.NameSortOrder = SortDir.Ascending; } else { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Descending)); SortColumn.NameSortOrder = SortDir.Descending; } } if (string.Equals(item, "Id", StringComparison.InvariantCultureIgnoreCase)) { // Paging.ViewList.View.Filter(propfull=) implement filter based on textBox if (SortColumn.NameSortOrder == SortDir.Descending) { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Ascending)); SortColumn.NameSortOrder = SortDir.Ascending; } else { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Descending)); SortColumn.NameSortOrder = SortDir.Descending; } } }, item => true); Paging.SearchByColumnCommand = new RelayCommand(() => { Paging.PeopleList = new ObservableCollection<EmpFormViewModel>(EmpList.Where(p => new SearchCondition(Paging, p).Evaluate())); }, () => true); IsImportDataVisible = true; }
public PagingCondition(PaginationViewModel paging, EmpFormViewModel model) { this.paging = paging; this.model = model; }
public EmpViewModel() { EmpList = EmpService.GetEmpList(); Paging = new PaginationViewModel { PeopleList = _empList, }; Paging.ViewList.Filter += ViewList_Filter; ImportCommand = new RelayCommand(() => { IsImportDataVisible = true; IsSearchVisible = false; }, () => true); SearchCommand = new RelayCommand(() => { IsImportDataVisible = false; IsSearchVisible = true; EmpFormViewModel = new EmpFormViewModel(); }, () => true); NavigateToForm = new RelayCommand <dynamic>(vm => { this.IsImportDataVisible = false; this.IsSearchVisible = true; if (vm != null) { EmpFormViewModel = vm; } }); SortCommand1 = new RelayCommand <dynamic>(item => { if (string.Equals(item, "Name", StringComparison.InvariantCultureIgnoreCase)) { if (SortColumn.NameSortOrder == SortDir.Descending) { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); SortColumn.NameSortOrder = SortDir.Ascending; } else { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Descending)); SortColumn.NameSortOrder = SortDir.Descending; } } if (string.Equals(item, "Id", StringComparison.InvariantCultureIgnoreCase)) { // Paging.ViewList.View.Filter(propfull=) implement filter based on textBox if (SortColumn.NameSortOrder == SortDir.Descending) { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Ascending)); SortColumn.NameSortOrder = SortDir.Ascending; } else { Paging.ViewList.SortDescriptions.Clear(); Paging.ViewList.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Descending)); SortColumn.NameSortOrder = SortDir.Descending; } } }, item => true); Paging.SearchByColumnCommand = new RelayCommand(() => { Paging.PeopleList = new ObservableCollection <EmpFormViewModel>(EmpList.Where(p => new SearchCondition(Paging, p).Evaluate())); }, () => true); IsImportDataVisible = true; }