private void MaintenanceByEmpId() { AllMaintenanceFiltered = new ObservableCollection <CarPresalesMaintenance>(AllMaintenance.Where(rid => rid.Employee.Id == SelectedEmployee.Id)); }
private void FilterMaintenance(object param) { if (!string.IsNullOrWhiteSpace(SearchedText)) { AllMaintenanceFiltered = new ObservableCollection <CarPresalesMaintenance>(AllMaintenanceFiltered.Where(kl => kl.RegNr.ToLower().StartsWith(SearchedText.ToLower()))); } else { if (SelectedEmployee == null) { AllMaintenanceFiltered = new ObservableCollection <CarPresalesMaintenance>(AllMaintenance); } else { AllMaintenanceFiltered = new ObservableCollection <CarPresalesMaintenance>(AllMaintenance.Where(rid => rid.Employee.Id == SelectedEmployee.Id)); } } }