diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp
index 47f77e36cf..792849c154 100644
--- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp
+++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp
@@ -2,8 +2,10 @@
#include "App.xaml.h"
#include "MainWindow.xaml.h"
-using namespace winrt;
-using namespace Microsoft::UI::Xaml;
+namespace winrt
+{
+ using namespace Microsoft::UI::Xaml;
+}
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -20,7 +22,7 @@ namespace winrt::$safeprojectname$::implementation
// See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
- UnhandledException([](IInspectable const&, UnhandledExceptionEventArgs const& e)
+ UnhandledException([](winrt::IInspectable const&, winrt::UnhandledExceptionEventArgs const& e)
{
if (IsDebuggerPresent())
{
@@ -35,9 +37,9 @@ namespace winrt::$safeprojectname$::implementation
/// Invoked when the application is launched.
///
/// Details about the launch request and process.
- void App::OnLaunched([[maybe_unused]] LaunchActivatedEventArgs const& e)
+ void App::OnLaunched([[maybe_unused]] winrt::LaunchActivatedEventArgs const& e)
{
- window = make();
+ window = winrt::make();
window.Activate();
}
}
diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp
index d6d47e7619..6aa751203c 100644
--- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp
+++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp
@@ -4,8 +4,10 @@
#include "MainWindow.g.cpp"
#endif
-using namespace winrt;
-using namespace Microsoft::UI::Xaml;
+namespace winrt
+{
+ using namespace Microsoft::UI::Xaml;
+}
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp
index 47f77e36cf..792849c154 100644
--- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp
+++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp
@@ -2,8 +2,10 @@
#include "App.xaml.h"
#include "MainWindow.xaml.h"
-using namespace winrt;
-using namespace Microsoft::UI::Xaml;
+namespace winrt
+{
+ using namespace Microsoft::UI::Xaml;
+}
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -20,7 +22,7 @@ namespace winrt::$safeprojectname$::implementation
// See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
- UnhandledException([](IInspectable const&, UnhandledExceptionEventArgs const& e)
+ UnhandledException([](winrt::IInspectable const&, winrt::UnhandledExceptionEventArgs const& e)
{
if (IsDebuggerPresent())
{
@@ -35,9 +37,9 @@ namespace winrt::$safeprojectname$::implementation
/// Invoked when the application is launched.
///
/// Details about the launch request and process.
- void App::OnLaunched([[maybe_unused]] LaunchActivatedEventArgs const& e)
+ void App::OnLaunched([[maybe_unused]] winrt::LaunchActivatedEventArgs const& e)
{
- window = make();
+ window = winrt::make();
window.Activate();
}
}
diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp
index d6d47e7619..6aa751203c 100644
--- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp
+++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp
@@ -4,8 +4,10 @@
#include "MainWindow.g.cpp"
#endif
-using namespace winrt;
-using namespace Microsoft::UI::Xaml;
+namespace winrt
+{
+ using namespace Microsoft::UI::Xaml;
+}
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.