private void ButtonClick(object sender, RoutedEventArgs e) { InputItem item = ((Button)e.Source).DataContext as InputItem; if (item is null) { return; } InputWindow w = new InputWindow(); w.Owner = this; w.InputItem = item; w.ShowDialog(); }
bool Filter(InputItem item) { string searchText = SearchControl.SearchTextBox.Text.ToLowerInvariant(); if (searchText == "") { return(true); } if (item.Command.ToLower().Contains(searchText) || item.Menu.ToLower().Contains(searchText) || item.Key.ToLower().Contains(searchText)) { return(true); } return(false); }