/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LimitCheckInButton_Click(object sender, RoutedEventArgs e) { try { CACCCheckInDb.Class selectedClass = (CACCCheckInDb.Class)LimitCheckInClassesComboBox.SelectedItem; if (null == selectedClass) { _exclusiveCheckInClass = null; return; } if (selectedClass.Name.Equals(String.Empty) && selectedClass.Id.Equals(new Guid("00000000-0000-0000-0000-000000000000"))) { _exclusiveCheckInClass = null; return; } _exclusiveCheckInClass = selectedClass; } catch (Exception) { _exclusiveCheckInClass = null; } finally { _peopleView.MoveCurrentToPosition(-1); _peopleView.MoveCurrentToFirst(); PeopleListBox.SelectedIndex = _peopleView.CurrentPosition; PeopleListBox.ScrollIntoView(_peopleView.CurrentItem); ExclusiveCheckInPanel.Visibility = Visibility.Collapsed; } }
/// <summary> /// Will filter the names which show up in the list for names /// </summary> /// <param name="filter"></param> private void FilterNamesInListBox(string filter) { if (_peopleView == null) { return; } _peopleView.Filter = p => ((CACCCheckInDb.PeopleWithDepartmentAndClassView)p).LastName.ToLower(). StartsWith(filter.ToLower()); _peopleView.MoveCurrentToFirst(); if (_peopleView.CurrentItem == null) { return; } PeopleListBox.ScrollIntoView(_peopleView.CurrentItem); }