private void SelectFirst() { if (SelectedItem != null) { return; } var first = ItemsView.OfType <SheetHandler>().FirstOrDefault(); if (first != null) { SelectedItem = first; } }
public void Find(object value) { var stringValue = value.ToString(); if (string.IsNullOrWhiteSpace(stringValue)) { return; } var property = (PropertyAdapter <TViewModel>)propertiesView.CurrentItem; var item = ItemsView.OfType <TViewModel>().FirstOrDefault(i => property.GetValue(i).ToString().StartsWith(stringValue, StringComparison.CurrentCultureIgnoreCase)); if (item != null) { ItemsView.MoveCurrentTo(item); } }