-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to file-scoped namespace #1689
Comments
Got an example? :) |
For example, App.xaml.cs: Block-scoped namespace namespace WinUIGallery
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
private static Window startupWindow; File-scoped namespace namespace WinUIGallery;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
private static Window startupWindow; |
If you let Visual Studio create such a new file, what does it initially look like? Why would VS prefer one over the other? |
Yeah. VS's item templates haven't been updated (yet?). |
Thanks for filing this issue. Would you want to take a stab at it? |
@karkarl Of course!🙂 |
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> This PR will switch C# files from block-scoped namespaces to file-scoped namespaces. Closes #1689. ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> Improves readability. ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> - Confirmed that all unit tests passes. - Run the app and navigated through all pages. ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change)
Issue type
enhancement
Which version of the app?
WinUI 3 Gallery
Description
File-scoped namespace will improve readability.
IMHO, it's something that will be done in the future, so why not now? The sooner, the better.
I'd be happy to do this.
Screenshots
No response
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: