diff --git a/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml b/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml index 3a8ac6e2..aeaeace7 100644 --- a/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml +++ b/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$itemname$"> + + + + diff --git a/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml.cs b/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml.cs index 1027c7b9..713c9c5e 100644 --- a/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml.cs +++ b/dev/VSIX/ItemTemplates/Desktop/CSharp/BlankWindow/BlankWindow.xaml.cs @@ -16,16 +16,15 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $rootnamespace$ +namespace $rootnamespace$; + +/// +/// An empty window that can be used on its own or navigated to within a Frame. +/// +public sealed partial class $safeitemname$ : Window { - /// - /// An empty window that can be used on its own or navigated to within a Frame. - /// - public sealed partial class $safeitemname$ : Window + public $safeitemname$() { - public $safeitemname$() - { - this.InitializeComponent(); - } + this.InitializeComponent(); } } diff --git a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.cpp b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.cpp index 71f96dbd..f1d60aa7 100644 --- a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.cpp +++ b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.cpp @@ -12,18 +12,17 @@ using namespace Microsoft::UI::Xaml; namespace winrt::$rootnamespace$::implementation { - int32_t $safeitemname$::MyProperty() + $safeitemname$::$safeitemname$() { - throw hresult_not_implemented(); } - void $safeitemname$::MyProperty(int32_t /* value */) + int32_t $safeitemname$::MyProperty() { throw hresult_not_implemented(); } - void $safeitemname$::myButton_Click(IInspectable const&, RoutedEventArgs const&) + void $safeitemname$::MyProperty(int32_t /* value */) { - myButton().Content(box_value(L"Clicked")); + throw hresult_not_implemented(); } } diff --git a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.h b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.h index 8eff169b..d7d67cec 100644 --- a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.h +++ b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.h @@ -6,16 +6,10 @@ namespace winrt::$rootnamespace$::implementation { struct $safeitemname$ : $safeitemname$T<$safeitemname$> { - $safeitemname$() - { - // Xaml objects should not call InitializeComponent during construction. - // See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent - } + $safeitemname$(); int32_t MyProperty(); void MyProperty(int32_t value); - - void myButton_Click(IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& args); }; } diff --git a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.xaml b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.xaml index 6084af2c..aeaeace7 100644 --- a/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.xaml +++ b/dev/VSIX/ItemTemplates/Desktop/CppWinRT/BlankWindow/BlankWindow.xaml @@ -9,7 +9,11 @@ mc:Ignorable="d" Title="$itemname$"> - - - + + + + + + + diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/BlankPage/BlankPage.xaml.cs b/dev/VSIX/ItemTemplates/Neutral/CSharp/BlankPage/BlankPage.xaml.cs index 834364fa..d1ab3b29 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CSharp/BlankPage/BlankPage.xaml.cs +++ b/dev/VSIX/ItemTemplates/Neutral/CSharp/BlankPage/BlankPage.xaml.cs @@ -16,16 +16,15 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $rootnamespace$ +namespace $rootnamespace$; + +/// +/// An empty page that can be used on its own or navigated to within a Frame. +/// +public sealed partial class $safeitemname$ : Page { - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class $safeitemname$ : Page + public $safeitemname$() { - public $safeitemname$() - { - this.InitializeComponent(); - } + this.InitializeComponent(); } } diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/CustomControl.cs b/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/CustomControl.cs index 1f7ae5c7..4016a8d6 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/CustomControl.cs +++ b/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/CustomControl.cs @@ -12,13 +12,12 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $rootnamespace$ +namespace $rootnamespace$; + +public sealed class $safeitemname$ : Control { - public sealed class $safeitemname$ : Control + public $safeitemname$() { - public $safeitemname$() - { - this.DefaultStyleKey = typeof($safeitemname$); - } + this.DefaultStyleKey = typeof($safeitemname$); } } diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs b/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs index c12c5ffd..8879093c 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs +++ b/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs @@ -16,13 +16,12 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $rootnamespace$ +namespace $rootnamespace$; + +public sealed partial class $safeitemname$ : UserControl { - public sealed partial class $safeitemname$ : UserControl + public $safeitemname$() { - public $safeitemname$() - { - this.InitializeComponent(); - } + this.InitializeComponent(); } } diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp index 71f96dbd..a097cc48 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp @@ -21,9 +21,4 @@ namespace winrt::$rootnamespace$::implementation { throw hresult_not_implemented(); } - - void $safeitemname$::myButton_Click(IInspectable const&, RoutedEventArgs const&) - { - myButton().Content(box_value(L"Clicked")); - } } diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h index 8eff169b..84cdc038 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h @@ -14,8 +14,6 @@ namespace winrt::$rootnamespace$::implementation int32_t MyProperty(); void MyProperty(int32_t value); - - void myButton_Click(IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& args); }; } diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml index 6b7755e3..3646967b 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml @@ -8,7 +8,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - - + + + diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp index 71f96dbd..a097cc48 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp @@ -21,9 +21,4 @@ namespace winrt::$rootnamespace$::implementation { throw hresult_not_implemented(); } - - void $safeitemname$::myButton_Click(IInspectable const&, RoutedEventArgs const&) - { - myButton().Content(box_value(L"Clicked")); - } } diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h index 8eff169b..84cdc038 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h @@ -14,8 +14,6 @@ namespace winrt::$rootnamespace$::implementation int32_t MyProperty(); void MyProperty(int32_t value); - - void myButton_Click(IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& args); }; } diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml index 64b205a7..85b00432 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml +++ b/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml @@ -8,7 +8,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - - + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs index cebd31a8..b536dc97 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs @@ -7,9 +7,8 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +public class Class1 { - public class Class1 - { - } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs index b6488bd6..fa69af15 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs @@ -19,32 +19,31 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application { /// - /// Provides application-specific behavior to supplement the default Application class. + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). /// - public partial class App : Application + public App() { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - } - - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - m_window = new MainWindow(); - m_window.Activate(); - } + this.InitializeComponent(); + } - private Window? m_window; + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); } + + private Window? m_window; } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml index e8e18c68..5c658fca 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs index a3d1e49a..6c84db4c 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs @@ -16,21 +16,20 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +/// +/// An empty window that can be used on its own or navigated to within a Frame. +/// +public sealed partial class MainWindow : Window { - /// - /// An empty window that can be used on its own or navigated to within a Frame. - /// - public sealed partial class MainWindow : Window + public MainWindow() { - public MainWindow() - { - this.InitializeComponent(); - } + this.InitializeComponent(); + } - private void myButton_Click(object sender, RoutedEventArgs e) - { - myButton.Content = "Clicked"; - } + private void myButton_Click(object sender, RoutedEventArgs e) + { + myButton.Content = "Clicked"; } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs index b6488bd6..fa69af15 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs @@ -19,32 +19,31 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application { /// - /// Provides application-specific behavior to supplement the default Application class. + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). /// - public partial class App : Application + public App() { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - } - - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - m_window = new MainWindow(); - m_window.Activate(); - } + this.InitializeComponent(); + } - private Window? m_window; + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); } + + private Window? m_window; } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml index e8e18c68..5c658fca 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs index a3d1e49a..6c84db4c 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs @@ -16,21 +16,20 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +/// +/// An empty window that can be used on its own or navigated to within a Frame. +/// +public sealed partial class MainWindow : Window { - /// - /// An empty window that can be used on its own or navigated to within a Frame. - /// - public sealed partial class MainWindow : Window + public MainWindow() { - public MainWindow() - { - this.InitializeComponent(); - } + this.InitializeComponent(); + } - private void myButton_Click(object sender, RoutedEventArgs e) - { - myButton.Content = "Clicked"; - } + private void myButton_Click(object sender, RoutedEventArgs e) + { + myButton.Content = "Clicked"; } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs index 9c6071da..12fc7bdb 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs @@ -20,38 +20,37 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class UnitTestApp : Application { /// - /// Provides application-specific behavior to supplement the default Application class. + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public UnitTestApp() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched. /// - public partial class UnitTestApp : Application + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public UnitTestApp() - { - this.InitializeComponent(); - } - - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); - - m_window = new UnitTestAppWindow(); - m_window.Activate(); - - UITestMethodAttribute.DispatcherQueue = m_window.DispatcherQueue; - - Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine); - } - - private Window? m_window; + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); + + m_window = new UnitTestAppWindow(); + m_window.Activate(); + + UITestMethodAttribute.DispatcherQueue = m_window.DispatcherQueue; + + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine); } + + private Window? m_window; } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml index 1aded3c2..4c0be8c7 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs index 27eb17bf..ebc859ff 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs @@ -16,13 +16,12 @@ // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. -namespace $safeprojectname$ +namespace $safeprojectname$; + +public sealed partial class UnitTestAppWindow : Window { - public sealed partial class UnitTestAppWindow : Window + public UnitTestAppWindow() { - public UnitTestAppWindow() - { - this.InitializeComponent(); - } + this.InitializeComponent(); } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs index eb6c4949..b0d8e08c 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs @@ -5,23 +5,22 @@ using System.Collections.Generic; using System.Linq; -namespace $safeprojectname$ +namespace $safeprojectname$; + +[TestClass] +public class UnitTest1 { - [TestClass] - public class UnitTest1 + [TestMethod] + public void TestMethod1() { - [TestMethod] - public void TestMethod1() - { - Assert.AreEqual(0, 0); - } + Assert.AreEqual(0, 0); + } - // Use the UITestMethod attribute for tests that need to run on the UI thread. - [UITestMethod] - public void TestMethod2() - { - var grid = new Grid(); - Assert.AreEqual(0, grid.MinWidth); - } + // Use the UITestMethod attribute for tests that need to run on the UI thread. + [UITestMethod] + public void TestMethod2() + { + var grid = new Grid(); + Assert.AreEqual(0, grid.MinWidth); } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp index d6d47e76..895787c9 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp @@ -12,6 +12,10 @@ using namespace Microsoft::UI::Xaml; namespace winrt::$safeprojectname$::implementation { + MainWindow::MainWindow() + { + } + int32_t MainWindow::MyProperty() { throw hresult_not_implemented(); diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h index 1077d33b..258de21a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h @@ -6,11 +6,7 @@ namespace winrt::$safeprojectname$::implementation { struct MainWindow : MainWindowT { - MainWindow() - { - // Xaml objects should not call InitializeComponent during construction. - // See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent - } + MainWindow(); int32_t MyProperty(); void MyProperty(int32_t value); diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml index e8e18c68..5c658fca 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp index d6d47e76..895787c9 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp @@ -12,6 +12,10 @@ using namespace Microsoft::UI::Xaml; namespace winrt::$safeprojectname$::implementation { + MainWindow::MainWindow() + { + } + int32_t MainWindow::MyProperty() { throw hresult_not_implemented(); diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h index 1077d33b..258de21a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h @@ -6,11 +6,7 @@ namespace winrt::$safeprojectname$::implementation { struct MainWindow : MainWindowT { - MainWindow() - { - // Xaml objects should not call InitializeComponent during construction. - // See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent - } + MainWindow(); int32_t MyProperty(); void MyProperty(int32_t value); diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml index e8e18c68..5c658fca 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp index 975ebe78..de1d7ee8 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp @@ -14,6 +14,5 @@ namespace winrt::$safeprojectname$::implementation { MainWindow::MainWindow() { - } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml index 66eaa157..1f0126bd 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml @@ -9,6 +9,10 @@ mc:Ignorable="d" Title="$projectname$"> + + + +