What are the naming conventions for internal
members in C#?
For example, default access modifier for WPF controls is internal - how should I name them?
What are the naming conventions for internal
members in C#?
For example, default access modifier for WPF controls is internal - how should I name them?
All non-public members should be lowerCamelCase
.
you don't usually name WPF controls. Unless you intend to use things such as UIA on them.
That being said, take a look at the Official C# Naming Conventions
Edit: Even if you plan to use UIA on your application, you should avoid naming controls unless needed. This encourages good practices (MVVM, separation of UI and logic) and prevents lazy / unexperienced developers from resorting to winforms-like code behind practices.
UIA may also rely on properties such as AutomationProperties.AutomationId
, therefore completely removing the need to give a name to WPF controls, unless of course you will use them as storyboard targets or you need some ElementName
binding.
Sometimes non-public members can be _lowerCamelCase.
Here is a link Naming convention - underscore in C++ and C# variables