From 9c1a9e2a409af637d3127caf0b9525902747290b Mon Sep 17 00:00:00 2001 From: Vincent Gromfeld Date: Thu, 3 Aug 2023 15:11:18 -0700 Subject: [PATCH 01/15] Port over content for StackedNotificationBehavior from Labs to Behaviors component --- .../Assets/StackedNotificationsBehavior.png | Bin 0 -> 3920 bytes .../samples/Behaviors.Samples.csproj | 2 +- .../samples/StackedNotificationsBehavior.md | 19 ++ ...ckedNotificationsBehaviorCustomSample.xaml | 27 +++ ...dNotificationsBehaviorCustomSample.xaml.cs | 45 ++++ .../src/Notification/Notification.cs | 112 ++++++++++ .../StackedNotificationsBehavior.cs | 209 ++++++++++++++++++ ...leStackedNotificationsBehaviorTestClass.cs | 52 +++++ 8 files changed, 465 insertions(+), 1 deletion(-) create mode 100644 components/Behaviors/samples/Assets/StackedNotificationsBehavior.png create mode 100644 components/Behaviors/samples/StackedNotificationsBehavior.md create mode 100644 components/Behaviors/samples/StackedNotificationsBehaviorCustomSample.xaml create mode 100644 components/Behaviors/samples/StackedNotificationsBehaviorCustomSample.xaml.cs create mode 100644 components/Behaviors/src/Notification/Notification.cs create mode 100644 components/Behaviors/src/Notification/StackedNotificationsBehavior.cs create mode 100644 components/Behaviors/tests/ExampleStackedNotificationsBehaviorTestClass.cs diff --git a/components/Behaviors/samples/Assets/StackedNotificationsBehavior.png b/components/Behaviors/samples/Assets/StackedNotificationsBehavior.png new file mode 100644 index 0000000000000000000000000000000000000000..c702cf87658b22fc4c52649606caf4857258f87a GIT binary patch literal 3920 zcmV-W53lfvP);M1&0drDELIAGL9O(c600d`2O+f$vv5yPZgw*p4JYpQx|CDJ>J{}9S^7$S zoz2=RS={Nv=>s`Y$Vw6wHUEkVh)k^94}DL$TYeeVPgKSA<1^W7!`k5Xo?fIaQ?4b2 zn%um`>yj1Rm*EPTRpub{tPcnZF?V{+3hKO+D8$w)VP2ezj&;nZiesSc@34-aV-eu7 zP!{1YPjxAHOf1;;3q*LC`R>UCPK33;xu7t-0pJ9RN(Ky@PXz}l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IOaq78j#@&iSSne>Mi_R2-A7@Jgt#A4L(Ab)B}uH2!567G5I%U9()74NfR z+~}P!{nn{h*N`sII%8{g#e(O#Ab=4#(}#OCHYY{QT(B_P6Uo#eNb?uZmd7|vMCMdK z=n%dt^1m`990b@+&s6aF67*~?4Ych-*1D9eBJM=r<|9vR!5VPMBHe*8mnf|4i&;Xl zAs>w+Rty5$BQ*A;0i;Qi!zr+Tb@pTX>?B{8aZG?oIYU996kcwgEmguFi)8*#I!PU# z4P(`y(rp2vaJX&+woQy;rUXf3$=XdZH-_d>Ox-U-rijzT$1d- z7#(a)rhF3>3}e^MtTDWx%&{J1_G}lFad}U9SzOTgHHoH0%X?Byicp-U+fmA=Wb74U zjdlvHLd(t+1oV{!0kK6-;|S5q@N2lk@(`!~j}H8lWQ`adajlM!*(U|V1Es8f$0WXZ eeewF-z5Wj}(D6a}FC$g}0000 - Always + PreserveNewest diff --git a/components/Behaviors/samples/StackedNotificationsBehavior.md b/components/Behaviors/samples/StackedNotificationsBehavior.md new file mode 100644 index 00000000..b60a45a1 --- /dev/null +++ b/components/Behaviors/samples/StackedNotificationsBehavior.md @@ -0,0 +1,19 @@ +--- +title: StackedNotificationsBehavior +author: vgromfeld +description: A behavior to add stacked notifications to a WinUI InfoBar control. +keywords: StackedNotificationsBehavior, Control, Layout, InfoBar, Behavior +dev_langs: + - csharp +category: Xaml +subcategory: Behaviors +discussion-id: 0 +issue-id: 0 +icon: Assets/StackedNotificationsBehavior.png +--- + +This initial example shows how to attach the behavior to an `InfoBar` and send it a message. + +Clicking on the button multiple times will queue up multiple messages to be displayed one after another. + +> [!Sample StackedNotificationsBehaviorCustomSample] diff --git a/components/Behaviors/samples/StackedNotificationsBehaviorCustomSample.xaml b/components/Behaviors/samples/StackedNotificationsBehaviorCustomSample.xaml new file mode 100644 index 00000000..aaf459ef --- /dev/null +++ b/components/Behaviors/samples/StackedNotificationsBehaviorCustomSample.xaml @@ -0,0 +1,27 @@ + + + + +