-
Notifications
You must be signed in to change notification settings - Fork 326
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
Update C# templates to introduce file scoped namespaces #4911
base: main
Are you sure you want to change the base?
Conversation
@haonanttt please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 more thing to be confirmed: |
I'm not as familiar with those, but it doesn't hurt to apply this change to every C# file across the entire repo. File-scoped namespaces were added for .NET 6, which should be everything here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦙❤️ Awesome, thanks @haonanttt for putting this together! 🎉🎉🎉 Couple of suggestions to improve partial class coverage for AOT and source generators.
I thought I remembered another small thing related to templates, but can't find it in my chat history. Nothing came to mind when going through the review. @niels9001 want to do a quick pass to see if I missed anything?
dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/CustomControl.cs
Outdated
Show resolved
Hide resolved
dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs
Outdated
Show resolved
Hide resolved
dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs
Outdated
Show resolved
Hide resolved
dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs
Outdated
Show resolved
Hide resolved
dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs
Outdated
Show resolved
Hide resolved
…hared folders as well
1. mark all classes 'partial' 2. align the MainWindow to be an empty Grid without the Button and handler
@haonanttt Love these changes 🚀! Since we are removing the Button click event, we should remove it from the With .NET9 WPF now comes with modern theming and has |
this.InitializeComponent(); | ||
} | ||
|
||
private void myButton_Click(object sender, RoutedEventArgs e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove this from the C++ templates as well
@@ -9,7 +9,7 @@ | |||
mc:Ignorable="d" | |||
Title="$projectname$"> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Window.SystemBackdrop> | |
<MicaBackdrop /> | |
</Window.SystemBackdrop> |
To enable Mica
.
@@ -9,7 +9,7 @@ | |||
mc:Ignorable="d" | |||
Title="$projectname$"> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Window.SystemBackdrop> | |
<MicaBackdrop /> | |
</Window.SystemBackdrop> |
To enable Mica
.
@niels9001 good call out! This may have been what I was thinking about unconsciously. It was pretty jarring to see the difference with the new WPF template/theming enabled and the WinUI window just being a black box during our .NET Conf demo: |
Purpose
Regarding to #3329, creating this PR to introduce file scoped namespaces.
What have changed
For all .cs files inside
dev/VSIX/ItemTemplates
anddev/VSIX/ProjectTemplates
, the template code format have been changed to file scoped namespaces: