Visual Studio can, for example, create event handlers automatically. I can create a handler directly from the XAML markup, while creating something like this in the code

private void Button_Click(object sender, EventArgs e) { } 

But we have the style of the code implies the absence of the private access modifier, as it is used by default. So, the question is: how to teach the studio to automatically create handlers not to add the word private ?

  • override will not help? - Senior Pomidor

1 answer 1

You can set parameters for generating Visual Studio code in the "Tools-> Options-Text Editor-> C # -> Code Style" window and also in neighboring nodes relative to the Code Style node.

As far as I know, you cannot set parameters for event generation there.

There is also an extension for Visual Studio , but it only works with WinForms (the author says that for WPF editor it is impossible to implement this extension).

For the general style of the code in the team I use ReSharper with general settings .