From c6259b738212ab711bea8a1560c5cf0bb34b823e Mon Sep 17 00:00:00 2001 From: Venkata Sharath Chandra Manchala Date: Mon, 12 Sep 2022 12:56:15 -0700 Subject: [PATCH 1/2] Rename CppUnpackagedAppNotifications to CppAppNotifications --- .../CppUnpackagedAppNotifications/App.xaml | 4 +- .../App.xaml.cpp | 2 +- .../CppUnpackagedAppNotifications/App.xaml.h | 2 +- .../CppUnpackagedAppNotifications.vcxproj | 19 ++++-- ...UnpackagedAppNotifications.vcxproj.filters | 2 +- .../MainPage.xaml | 4 +- .../MainPage.xaml.cpp | 4 +- .../MainPage.xaml.h | 10 +-- .../MainWindow.xaml | 4 +- .../MainWindow.xaml.cpp | 4 +- .../MainWindow.xaml.h | 4 +- .../Notifications/NotificationManager.cpp | 2 +- .../Notifications/ToastWithAvatar.cpp | 4 +- .../Notifications/ToastWithTextBox.cpp | 4 +- .../NotifyUser.cpp | 2 +- .../CppUnpackagedAppNotifications/Project.idl | 2 +- .../SampleConfiguration.cpp | 8 +-- .../SampleConfiguration.h | 2 +- .../Scenario1_ToastWithAvatar.xaml | 4 +- .../Scenario1_ToastWithAvatar.xaml.cpp | 2 +- .../Scenario1_ToastWithAvatar.xaml.h | 6 +- .../Scenario2_ToastWithTextBox.xaml | 4 +- .../Scenario2_ToastWithTextBox.xaml.cpp | 2 +- .../Scenario2_ToastWithTextBox.xaml.h | 6 +- .../SettingsPage.xaml | 4 +- .../SettingsPage.xaml.cpp | 2 +- .../SettingsPage.xaml.h | 4 +- .../CppUnpackagedAppNotifications/Styles.xaml | 2 +- .../app.manifest | 2 +- .../App/Resources/Package.appxmanifest | 62 +++++++++++++++++++ 30 files changed, 128 insertions(+), 55 deletions(-) create mode 100644 Samples/Notifications/App/Resources/Package.appxmanifest diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml index 20eced5b4..8eddf8852 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml @@ -1,10 +1,10 @@  + xmlns:local="using:CppAppNotifications"> diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.cpp index f1cf02566..66cf18702 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.cpp @@ -24,7 +24,7 @@ namespace winrt // instance variable goes out of scope, i.e.: when the App is terminated. static NotificationManager g_notificationManager; -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { static App* app{ nullptr }; diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.h index 7979826dc..66413ede0 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/App.xaml.h @@ -5,7 +5,7 @@ #include "App.xaml.g.h" #include "pch.h" -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct App : AppT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj index 88ff48e54..a81017359 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj @@ -8,8 +8,8 @@ true true {ba5623de-515a-4d7e-9110-38d1641f5fe0} - CppUnpackagedAppNotifications - CppUnpackagedAppNotifications + CppAppNotifications + CppAppNotifications diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.cpp index 14f51f2f9..93095b2e9 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.cpp @@ -18,9 +18,9 @@ namespace winrt using namespace Windows::UI::Xaml::Interop; } -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { - CppUnpackagedAppNotifications::MainPage MainPage::current{ nullptr }; + CppAppNotifications::MainPage MainPage::current{ nullptr }; MainPage::MainPage() { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.h index 2c1d18d40..0074a9959 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainPage.xaml.h @@ -4,13 +4,13 @@ #pragma once #include "MainPage.g.h" -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct MainPage : MainPageT { MainPage(); - static CppUnpackagedAppNotifications::MainPage Current() { return current; } - static Windows::Foundation::Collections::IVector Scenarios() { return scenariosInner; } + static CppAppNotifications::MainPage Current() { return current; } + static Windows::Foundation::Collections::IVector Scenarios() { return scenariosInner; } void NotificationReceived(Notification const& notification); void NotifyUser(hstring const& strMessage, Microsoft::UI::Xaml::Controls::InfoBarSeverity const& severity); void UpdateStatus(hstring const& strMessage, Microsoft::UI::Xaml::Controls::InfoBarSeverity severity); @@ -22,7 +22,7 @@ namespace winrt::CppUnpackagedAppNotifications::implementation private: static Windows::Foundation::Collections::IVector scenariosInner; - static CppUnpackagedAppNotifications::MainPage current; + static CppAppNotifications::MainPage current; void NavView_NavigateToPage(winrt::Windows::UI::Xaml::Interop::TypeName const& pageType); @@ -30,7 +30,7 @@ namespace winrt::CppUnpackagedAppNotifications::implementation }; } -namespace winrt::CppUnpackagedAppNotifications::factory_implementation +namespace winrt::CppAppNotifications::factory_implementation { struct MainPage : MainPageT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml index d785bf587..e9be07d84 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml @@ -1,10 +1,10 @@  diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.cpp index 2fb2b159a..11e47ea37 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.cpp @@ -16,13 +16,13 @@ namespace winrt using namespace Microsoft::UI::Xaml; } -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { MainWindow::MainWindow() { InitializeComponent(); - Title(winrt::CppUnpackagedAppNotifications::SampleConfig::FeatureName); + Title(winrt::CppAppNotifications::SampleConfig::FeatureName); HWND hwnd = GetWindowHandle(); LoadIcon(hwnd, L"Assets/windows-sdk.ico"); diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.h index 728d13129..3696d8862 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/MainWindow.xaml.h @@ -5,7 +5,7 @@ #include "MainWindow.g.h" #include "pch.h" -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct MainWindow : MainWindowT { @@ -21,7 +21,7 @@ namespace winrt::CppUnpackagedAppNotifications::implementation }; } -namespace winrt::CppUnpackagedAppNotifications::factory_implementation +namespace winrt::CppAppNotifications::factory_implementation { struct MainWindow : MainWindowT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/NotificationManager.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/NotificationManager.cpp index eb953137a..4fa719673 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/NotificationManager.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/NotificationManager.cpp @@ -17,7 +17,7 @@ namespace winrt { using namespace Microsoft::UI::Xaml::Controls; using namespace Microsoft::Windows::AppNotifications; - using namespace CppUnpackagedAppNotifications::implementation; + using namespace CppAppNotifications::implementation; } static const std::map> c_notificationHandlers diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithAvatar.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithAvatar.cpp index 52d9661ba..4e35f1dea 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithAvatar.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithAvatar.cpp @@ -14,7 +14,7 @@ namespace winrt { using namespace Microsoft::Windows::AppNotifications; using namespace Microsoft::Windows::AppNotifications::Builder; - using namespace CppUnpackagedAppNotifications::implementation; + using namespace CppAppNotifications::implementation; } const wchar_t* ToastWithAvatar::ScenarioName{ L"Local Toast with Avatar Image" }; @@ -39,7 +39,7 @@ bool ToastWithAvatar::SendToast() void ToastWithAvatar::NotificationReceived(winrt::Microsoft::Windows::AppNotifications::AppNotificationActivatedEventArgs const& notificationActivatedEventArgs) { - winrt::CppUnpackagedAppNotifications::Notification notification{}; + winrt::CppAppNotifications::Notification notification{}; notification.Originator = ScenarioName; notification.Action = notificationActivatedEventArgs.Arguments().Lookup(L"action"); winrt::MainPage::Current().NotificationReceived(notification); diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithTextBox.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithTextBox.cpp index eb18b57bb..b9aa05fa2 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithTextBox.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Notifications/ToastWithTextBox.cpp @@ -13,7 +13,7 @@ namespace winrt { using namespace Microsoft::Windows::AppNotifications; using namespace Microsoft::Windows::AppNotifications::Builder; - using namespace CppUnpackagedAppNotifications::implementation; + using namespace CppAppNotifications::implementation; } const wchar_t* ToastWithTextBox::ScenarioName{ L"Local Toast with Avatar and Text Box" }; @@ -48,7 +48,7 @@ void ToastWithTextBox::NotificationReceived(winrt::Microsoft::Windows::AppNotifi - winrt::CppUnpackagedAppNotifications::Notification notification{}; + winrt::CppAppNotifications::Notification notification{}; notification.Originator = ScenarioName; notification.Action = notificationActivatedEventArgs.Arguments().Lookup(L"action"); notification.HasInput = true; diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/NotifyUser.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/NotifyUser.cpp index c6696da88..194af28fa 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/NotifyUser.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/NotifyUser.cpp @@ -6,7 +6,7 @@ namespace winrt { using namespace Microsoft::UI::Xaml::Controls; - using namespace winrt::CppUnpackagedAppNotifications::implementation; + using namespace winrt::CppAppNotifications::implementation; } void NotifyUser::CouldNotSendToast() diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Project.idl b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Project.idl index e83ce07b8..46f760d92 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Project.idl +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Project.idl @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -namespace CppUnpackagedAppNotifications +namespace CppAppNotifications { /* The following code is scenario/feature-specific IDL. Samples authors should modify these runtime classes as appropriate. */ diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.cpp index d619ac12f..4bcdec55e 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.cpp @@ -14,14 +14,14 @@ namespace winrt using namespace Windows::Foundation::Collections; } -namespace winrt::CppUnpackagedAppNotifications +namespace winrt::CppAppNotifications { IVector implementation::MainPage::scenariosInner = single_threaded_observable_vector( { - Scenario{ ToastWithAvatar::ScenarioName, hstring(name_of())}, - Scenario{ ToastWithTextBox::ScenarioName, hstring(name_of())} + Scenario{ ToastWithAvatar::ScenarioName, hstring(name_of())}, + Scenario{ ToastWithTextBox::ScenarioName, hstring(name_of())} }); - hstring SampleConfig::FeatureName{ L"CppUnpackagedAppNotifications" }; + hstring SampleConfig::FeatureName{ L"CppAppNotifications" }; ElementTheme SampleConfig::CurrentTheme{ ElementTheme::Default }; } diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.h index 325e27628..8bc7d8f5a 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SampleConfiguration.h @@ -4,7 +4,7 @@ #pragma once #include "pch.h" -namespace winrt::CppUnpackagedAppNotifications +namespace winrt::CppAppNotifications { struct SampleConfig { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml index 35e93958c..2d69e121b 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml @@ -1,10 +1,10 @@  diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.cpp index 458e12ba1..d2b4dffc1 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.cpp @@ -16,7 +16,7 @@ namespace winrt using namespace Microsoft::Windows::AppNotifications; } -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { MainPage Scenario1_ToastWithAvatar::rootPage{ nullptr }; diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.h index 9b0db5aa7..fa34f5b1d 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario1_ToastWithAvatar.xaml.h @@ -6,7 +6,7 @@ #include "Scenario1_ToastWithAvatar.g.h" #include -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct Scenario1_ToastWithAvatar : Scenario1_ToastWithAvatarT { @@ -15,11 +15,11 @@ namespace winrt::CppUnpackagedAppNotifications::implementation void SendToast_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&); private: - static CppUnpackagedAppNotifications::MainPage rootPage; + static CppAppNotifications::MainPage rootPage; }; } -namespace winrt::CppUnpackagedAppNotifications::factory_implementation +namespace winrt::CppAppNotifications::factory_implementation { struct Scenario1_ToastWithAvatar : Scenario1_ToastWithAvatarT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml index 1ba0411a7..c5f13bad5 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml @@ -1,10 +1,10 @@  diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.cpp index f29a73250..ecc2101bf 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.cpp @@ -16,7 +16,7 @@ namespace winrt using namespace Microsoft::Windows::AppNotifications; } -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { MainPage Scenario2_ToastWithTextBox::rootPage{ nullptr }; diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.h index a1924d5ec..d315415d7 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Scenario2_ToastWithTextBox.xaml.h @@ -5,7 +5,7 @@ #include "Scenario2_ToastWithTextBox.g.h" -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct Scenario2_ToastWithTextBox : Scenario2_ToastWithTextBoxT { @@ -14,11 +14,11 @@ namespace winrt::CppUnpackagedAppNotifications::implementation void SendToast_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&); private: - static CppUnpackagedAppNotifications::MainPage rootPage; + static CppAppNotifications::MainPage rootPage; }; } -namespace winrt::CppUnpackagedAppNotifications::factory_implementation +namespace winrt::CppAppNotifications::factory_implementation { struct Scenario2_ToastWithTextBox : Scenario2_ToastWithTextBoxT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml index dc02cf982..5fa032665 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml @@ -1,10 +1,10 @@  diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.cpp b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.cpp index 596442130..461901b65 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.cpp +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.cpp @@ -16,7 +16,7 @@ namespace winrt using namespace Windows::Foundation; } -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { SettingsPage::SettingsPage() { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.h b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.h index 56823edea..4c9a34f4f 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.h +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/SettingsPage.xaml.h @@ -5,7 +5,7 @@ #include "SettingsPage.g.h" -namespace winrt::CppUnpackagedAppNotifications::implementation +namespace winrt::CppAppNotifications::implementation { struct SettingsPage : SettingsPageT { @@ -15,7 +15,7 @@ namespace winrt::CppUnpackagedAppNotifications::implementation }; } -namespace winrt::CppUnpackagedAppNotifications::factory_implementation +namespace winrt::CppAppNotifications::factory_implementation { struct SettingsPage : SettingsPageT { diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Styles.xaml b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Styles.xaml index 66eb99ced..5e2b9773f 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Styles.xaml +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/Styles.xaml @@ -3,7 +3,7 @@ + xmlns:local="using:CppAppNotifications"> diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/app.manifest b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/app.manifest index 797bbb81a..5e31ec734 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/app.manifest +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/app.manifest @@ -1,6 +1,6 @@ - + diff --git a/Samples/Notifications/App/Resources/Package.appxmanifest b/Samples/Notifications/App/Resources/Package.appxmanifest new file mode 100644 index 000000000..11408636b --- /dev/null +++ b/Samples/Notifications/App/Resources/Package.appxmanifest @@ -0,0 +1,62 @@ + + + + + + + + CppAppNotifications + Microsoft Corporation + Assets\logo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b2b7fa38c24862aef08dcd4ca31f9180ee4db496 Mon Sep 17 00:00:00 2001 From: Venkata Sharath Chandra Manchala Date: Mon, 12 Sep 2022 13:29:12 -0700 Subject: [PATCH 2/2] Update Readme --- .../CppUnpackagedAppNotifications.vcxproj | 11 ----------- Samples/Notifications/App/README.md | 7 +++++++ .../Notifications/App/Resources/Package.appxmanifest | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj index a81017359..5a8669030 100644 --- a/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj +++ b/Samples/Notifications/App/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications/CppUnpackagedAppNotifications.vcxproj @@ -59,17 +59,6 @@ v143 Unicode true - True - True - B4119ED1B5FC4CBCAE169E9C03C9F001803FDA81 - SHA256 - True - C:\Users\vemancha\Desktop\validation4\ - False - True - Never - C:\Users\vemancha\Desktop\validation4\ - 0 true diff --git a/Samples/Notifications/App/README.md b/Samples/Notifications/App/README.md index 0cd4d2d41..29b6adfc5 100644 --- a/Samples/Notifications/App/README.md +++ b/Samples/Notifications/App/README.md @@ -54,6 +54,13 @@ At the very least, that means adding an entry to describe your scenario, near th Verify your new scenario builds (without warnings), that it works as expected and has been implemented for all flavors of the sample (C++/C#, Packaged/Unpackaged, etc.). Go to the [WindowsAppSDK-Samples](https://github.com/microsoft/WindowsAppSDK-Samples) GitHub and follow the Contributing Guidelines (at the bottom of the readme) and submit ytour code changes for peer review. +6. **Converting the Unpackaged Sample to Packaged Sample** - +Sample can be converted to Packaged by following the guidance: https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/single-project-msix?tabs=cpp + - **For a C++ Sample** - Set the below properties: + 1. Open the vcxproj and set the AppxPackage property to true and WindowsPackageType to MSIX + 3. Copy the provided sample Package.appxmanifest file under App/Resources/ to the unpackaged app solution. Note the provided manifest is only for reference modify the parameters as per the documentation: + https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/notifications/app-notifications/app-notifications-quickstart?tabs=cs + ## Notes Scenario do not persist. When the user move between scenario, the old scenario is deleted and a new one is create. Keep this in mind when designing your own scenario. diff --git a/Samples/Notifications/App/Resources/Package.appxmanifest b/Samples/Notifications/App/Resources/Package.appxmanifest index 11408636b..2b6598be8 100644 --- a/Samples/Notifications/App/Resources/Package.appxmanifest +++ b/Samples/Notifications/App/Resources/Package.appxmanifest @@ -47,7 +47,7 @@ - +