mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
Fixed null reference in Keybindings Scenario and hotkey collision (#1965)
This commit is contained in:
@@ -132,7 +132,7 @@ namespace UICatalog {
|
||||
Width = Dim.Percent (50),
|
||||
Height = Dim.Percent (100) - 1,
|
||||
};
|
||||
commandsListView.SelectedItemChanged += CommandsListView_SelectedItemChanged;
|
||||
|
||||
Add (commandsListView);
|
||||
|
||||
keyLabel = new Label () {
|
||||
@@ -143,7 +143,7 @@ namespace UICatalog {
|
||||
};
|
||||
Add (keyLabel);
|
||||
|
||||
var btnChange = new Button ("Change") {
|
||||
var btnChange = new Button ("Ch_ange") {
|
||||
X = Pos.Percent (50),
|
||||
Y = 1,
|
||||
};
|
||||
@@ -160,6 +160,13 @@ namespace UICatalog {
|
||||
var cancel = new Button ("Cancel");
|
||||
cancel.Clicked += ()=>Application.RequestStop();
|
||||
AddButton (cancel);
|
||||
|
||||
// Register event handler as the last thing in constructor to prevent early calls
|
||||
// before it is even shown (e.g. OnEnter)
|
||||
commandsListView.SelectedItemChanged += CommandsListView_SelectedItemChanged;
|
||||
|
||||
// Setup to show first ListView entry
|
||||
SetTextBoxToShowBinding (commands.First());
|
||||
}
|
||||
|
||||
private void RemapKey ()
|
||||
|
||||
Reference in New Issue
Block a user