Search code examples
wpffunctionshortcutauto-generate

double click WPF event shortcut for deleting auto generated function and XAML added tags


When I double click on my User Control file, system auto generates a UserControl_Loaded function in .cs file and adds loaded tag in XAML as Loaded="UserControl_Loaded" for UserControl element. It also defines an eventHandler to this.Any shortcut in VS to undo this operation quickly?


Solution

  • You can just Undo once in the .xaml.cs and then flip back to the .xaml and Undo once there and you'll be back to the initial state. Quick keyboard sequence is Ctrl-Z, Ctrl-Tab, Ctrl-Z.