mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
Set up bindings for Ctrl+T and Ctrl+W, to Open and Close tabs respectively.
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
Title="CefSharp.Wpf.Example"
|
||||
WindowState="Maximized">
|
||||
|
||||
<Window.InputBindings>
|
||||
<KeyBinding Key="T" Modifiers="Control" Command="New"/>
|
||||
<KeyBinding Key="W" Modifiers="Control" Command="Close"/>
|
||||
</Window.InputBindings>
|
||||
<Grid>
|
||||
<controls:NonReloadingTabControl x:Name="TabControl"
|
||||
Margin="0,5,0,0"
|
||||
|
||||
@@ -23,6 +23,9 @@ namespace CefSharp.Wpf.Example
|
||||
|
||||
BrowserTabs = new ObservableCollection<BrowserTabViewModel>();
|
||||
|
||||
CommandBindings.Add(new CommandBinding(ApplicationCommands.New, OpenNewTab));
|
||||
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, CloseTab));
|
||||
|
||||
Loaded += MainWindowLoaded;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user