Skip to content

Commit 226b5e3

Browse files
drewbatgitCopilot
andcommitted
Remove Community Toolkit references from includes and misc files
Update include files and remaining content files to remove Community Toolkit notification references: - includes/send-toast-basic-toast-intro.md: Remove toolkit API mention - includes/send-toast-intro.md: Remove toolkit library mention - send-local-toast-cpp-uwp.md: Remove all Builder syntax (toolkit) tabs, leaving only XML approach; consolidate from 4 steps to 3 - toast-schema.md: Update/remove toolkit library references Note: includes/nuget-package.md is unchanged because it is also referenced by the WinAppSDK migration guide (out of scope for this PR). Co-authored-by: Copilot <[email protected]>
1 parent 9f5902a commit 226b5e3

4 files changed

Lines changed: 7 additions & 113 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
In Windows 10 and Windows 11, your app notification content is described using an adaptive language that allows great flexibility with how your notification looks. For more information, see the [App notification content](../adaptive-interactive-toasts.md) documentation.
22

3-
We'll start with a simple text-based notification. Construct the notification content and show the notification! You can use the [Windows App SDK](/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder) `AppNotificationBuilder` APIs or the [Windows Community Toolkit](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/) `ToastContentBuilder` APIs.
3+
We'll start with a simple text-based notification. Construct the notification content and show the notification! You can use the [Windows App SDK](/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder) `AppNotificationBuilder` APIs.
44

55
<img alt="Simple text notification" src="../images/send-toast-01.png" width="364"/>

hub/apps/develop/notifications/app-notifications/includes/send-toast-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ An app notification is a message that your app can construct and deliver to your
22

33
<img src="../images/toast-notification.png" width="628" alt="Screenshot of an app notification"/>
44

5-
This quickstart walks you through the steps to create, deliver, and display a Windows 10 or Windows 11 app notification using rich content and interactive actions. This quickstart uses local notifications, which are the simplest notification to implement. All types of apps (WinUI, WPF, WinForms, console) can send notifications with the [Windows App SDK](/windows/apps/windows-app-sdk/) or the [Windows Community Toolkit Notifications library](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/).
5+
This quickstart walks you through the steps to create, deliver, and display a Windows 10 or Windows 11 app notification using rich content and interactive actions. This quickstart uses local notifications, which are the simplest notification to implement. All types of apps (WinUI, WPF, WinForms, console) can send notifications with the [Windows App SDK](/windows/apps/windows-app-sdk/).

hub/apps/develop/notifications/app-notifications/send-local-toast-cpp-uwp.md

Lines changed: 4 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,18 @@ no-loc: [toast, Toast, app, App]
2323
> [!NOTE]
2424
> For C++ apps using the Windows App SDK, see [Quickstart: App notifications in the Windows App SDK](app-notifications-quickstart.md) which covers the recommended approach using the `Microsoft.Windows.AppNotifications` APIs.
2525
26-
## Step 1: Install NuGet package
27-
28-
You can create app notifications with the Windows Community Toolkit (WCT)'s builder syntax OR with XML. If you prefer the latter, please skip to **Step 2** and refer to the **Without builder syntax** code examples.
29-
30-
[!INCLUDE [nuget package](includes/nuget-package.md)]
31-
32-
Our **Builder syntax** code examples will use this package. This package allows you to create app notifications without using XML.
33-
34-
## Step 2: Add namespace declarations
35-
36-
#### [Builder syntax](#tab/builder-syntax)
37-
38-
```cpp
39-
using namespace Microsoft::Toolkit::Uwp::Notifications;
40-
```
41-
42-
#### [Without builder syntax](#tab/xml)
26+
## Step 1: Add namespace declarations
4327

4428
```cpp
4529
using namespace winrt::Windows::UI::Notifications;
4630
using namespace Windows::Data::Xml::Dom;
4731
```
4832
49-
---
50-
51-
## Step 3: Send an app notification
33+
## Step 2: Send an app notification
5234
5335
[!INCLUDE [basic toast intro](includes/send-toast-basic-toast-intro.md)]
5436
55-
If you are not using the WCT Notifications library builder syntax, you will instead construct the XML app notification template, populate it with text and values, construct the notification, and show it.
56-
57-
#### [Builder syntax](#tab/builder-syntax)
58-
59-
```cpp
60-
// Construct the content and show the toast!
61-
(ref new ToastContentBuilder())
62-
->AddArgument("action", "viewConversation")
63-
->AddArgument("conversationId", 9813)
64-
->AddText("Andrew sent you a picture")
65-
->AddText("Check this out, The Enchantments in Washington!")
66-
->Show();
67-
```
68-
69-
#### [Without builder syntax](#tab/xml)
37+
Construct the XML app notification template, populate it with text and values, construct the notification, and show it.
7038
7139
```cpp
7240
// Construct the XML toast template
@@ -95,9 +63,7 @@ ToastNotifier toastNotifier{ toastManager.CreateToastNotifier() };
9563
toastNotifier.Show(notif);
9664
```
9765

98-
---
99-
100-
## Step 4: Handle activation
66+
## Step 3: Handle activation
10167

10268
When the user clicks your notification (or a button on the notification with foreground activation), your app's **App.xaml.cpp** **OnActivated** will be invoked.
10369

@@ -128,22 +94,6 @@ void App::OnActivated(IActivatedEventArgs^ e)
12894
12995
The first step in making your notifications actionable is to add some launch args to your notification, so that your app can know what to launch when the user clicks the notification (in this case, we're including some information that later tells us we should open a conversation, and we know which specific conversation to open).
13096
131-
#### [Builder syntax](#tab/builder-syntax)
132-
133-
```cpp
134-
// Construct the content and show the toast!
135-
(ref new ToastContentBuilder())
136-
137-
// Arguments returned when user taps body of notification
138-
->AddArgument("action", "viewConversation")
139-
->AddArgument("conversationId", 9813)
140-
141-
->AddText("Andrew sent you a picture")
142-
->Show();
143-
```
144-
145-
#### [Without builder syntax](#tab/xml)
146-
14797
```cpp
14898
// Construct the XML toast template
14999
XmlDocument doc;
@@ -173,8 +123,6 @@ ToastNotifier toastNotifier{ toastManager.CreateToastNotifier() };
173123
toastNotifier.Show(notif);
174124
```
175125

176-
---
177-
178126
## Add images
179127

180128
You can add rich content to notifications. We'll add an inline image and a profile (app logo override) image.
@@ -183,24 +131,6 @@ You can add rich content to notifications. We'll add an inline image and a profi
183131

184132
<img alt="App notification with images" src="images/send-toast-02.png" width="364"/>
185133

186-
#### [Builder syntax](#tab/builder-syntax)
187-
188-
```cpp
189-
// Construct the content and show the toast!
190-
(ref new ToastContentBuilder())
191-
...
192-
193-
// Inline image
194-
->AddInlineImage(ref new Uri("https://picsum.photos/360/202?image=883"))
195-
196-
// Profile (app logo override) image
197-
->AddAppLogoOverride(ref new Uri("ms-appdata:///local/Andrew.jpg"), ToastGenericAppLogoCrop::Circle)
198-
199-
->Show();
200-
```
201-
202-
#### [Without builder syntax](#tab/xml)
203-
204134
```cpp
205135
// Construct the XML toast template
206136
XmlDocument doc;
@@ -236,45 +166,12 @@ ToastNotifier toastNotifier{ toastManager.CreateToastNotifier() };
236166
toastNotifier.Show(notif);
237167
```
238168
239-
---
240-
241169
## Add buttons and inputs
242170
243171
You can add buttons and inputs to make your notifications interactive. Buttons can launch your foreground app, a protocol, or your background task. We'll add a reply text box, a "Like" button, and a "View" button that opens the image.
244172
245173
<img src="images/toast-notification.png" width="628" alt="Screenshot of an app notification with inputs and buttons"/>
246174
247-
#### [Builder syntax](#tab/builder-syntax)
248-
249-
```cpp
250-
// Construct the content
251-
(ref new ToastContentBuilder())
252-
->AddArgument("conversationId", 9813)
253-
...
254-
255-
// Text box for replying
256-
->AddInputTextBox("tbReply", "Type a response")
257-
258-
// Buttons
259-
->AddButton((ref new ToastButton())
260-
->SetContent("Reply")
261-
->AddArgument("action", "reply")
262-
->SetBackgroundActivation())
263-
264-
->AddButton((ref new ToastButton())
265-
->SetContent("Like")
266-
->AddArgument("action", "like")
267-
->SetBackgroundActivation())
268-
269-
->AddButton((ref new ToastButton())
270-
->SetContent("View")
271-
->AddArgument("action", "view"))
272-
273-
->Show();
274-
```
275-
276-
#### [Without builder syntax](#tab/xml)
277-
278175
```cpp
279176
// Construct the XML toast template
280177
XmlDocument doc;
@@ -323,8 +220,6 @@ ToastNotifier toastNotifier{ toastManager.CreateToastNotifier() };
323220
toastNotifier.Show(notif);
324221
```
325222

326-
---
327-
328223
The activation of foreground buttons are handled in the same way as the main notification body (your App.xaml.cpp OnActivated will be called).
329224

330225
## Handle background activation

hub/apps/develop/notifications/app-notifications/toast-schema.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.localizationpriority: medium
1515

1616
The following describes all of the properties and elements within toast content.
1717

18-
If you would rather use raw XML instead of the [Notifications library](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/), please see [the XML schema](/uwp/schemas/tiles/toastschema/schema-root).
18+
If you would rather use raw XML instead of the Windows App SDK builder APIs, please see [the XML schema](/uwp/schemas/tiles/toastschema/schema-root).
1919

2020
[ToastContent](#toastcontent)
2121
* [ToastVisual](#toastvisual)
@@ -474,4 +474,3 @@ New in Creators Update: A custom header that groups multiple notifications toget
474474
## Related topics
475475

476476
* [Quickstart: Send a local toast and handle activation](/archive/blogs/tiles_and_toasts/quickstart-sending-a-local-toast-notification-and-handling-activations-from-it-windows-10)
477-
* [Notifications library on GitHub](https://github.com/windows-toolkit/WindowsCommunityToolkit)

0 commit comments

Comments
 (0)