Added Control-F Search
This commit is contained in:
@ -26,6 +26,7 @@ namespace WGneu.Windows
|
||||
private bool isEditing = false;
|
||||
private bool isCreating = false;
|
||||
private List<string> textFilter = new();
|
||||
private static RoutedCommand controlF = new RoutedCommand();
|
||||
private readonly WgContext context = new();
|
||||
|
||||
public MemberListWindow()
|
||||
@ -38,6 +39,8 @@ namespace WGneu.Windows
|
||||
RefreshMemberList();
|
||||
BranchInput.ItemsSource = context.Branches.OrderBy(b => b.Name).ToList();
|
||||
DefaultKgInput.ItemsSource = context.WbKgs.Select(k => k.Kg).OrderBy(k => k.Name).ToList();
|
||||
controlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
|
||||
CommandBindings.Add(new CommandBinding(controlF, FocusSearchInput));
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
@ -233,6 +236,15 @@ namespace WGneu.Windows
|
||||
RefreshMemberList();
|
||||
}
|
||||
|
||||
private void FocusSearchInput(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isEditing)
|
||||
{
|
||||
SearchInput.Focus();
|
||||
SearchInput.SelectAll();
|
||||
}
|
||||
}
|
||||
|
||||
private int NextMgNr()
|
||||
{
|
||||
int c = context.Members.Select(m => m.MgNr).Min();
|
||||
|
Reference in New Issue
Block a user