├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Wiki └── Tiles │ └── GroupsAndSubgroups │ ├── GroupsDesktop.png │ └── GroupsTablet.png ├── Windows 10 ├── GenerateNugetPackage.bat ├── LICENSE ├── NotificationsExtensions.SampleApp │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Apps │ │ │ └── Weather │ │ │ │ ├── Cloudy-Square.png │ │ │ │ ├── Cloudy.png │ │ │ │ ├── Drizzle-Square.png │ │ │ │ ├── Drizzle.png │ │ │ │ ├── Haze-Square.png │ │ │ │ ├── Haze.png │ │ │ │ ├── Mostly Cloudy-Background.jpg │ │ │ │ ├── Mostly Cloudy-Square.png │ │ │ │ ├── Mostly Cloudy.png │ │ │ │ ├── Slight Drizzle-Square.png │ │ │ │ ├── Slight Drizzle.png │ │ │ │ ├── Snow-Square.png │ │ │ │ ├── Snow.png │ │ │ │ ├── Sunny-Square.png │ │ │ │ ├── Sunny.png │ │ │ │ ├── Thunderstorms-Square.png │ │ │ │ └── Thunderstorms.png │ │ ├── Images │ │ │ └── map.jpg │ │ ├── Logo.scale-100.png │ │ ├── Samples │ │ │ ├── Tiles │ │ │ │ ├── CirclePeek.png │ │ │ │ ├── HeavyOverlay.png │ │ │ │ ├── PeekAndBackground.png │ │ │ │ └── PeekOverlay.png │ │ │ └── Toasts │ │ │ │ ├── CustomSnoozeAndDismissText.jpg │ │ │ │ ├── CustomSnoozeTimes.jpg │ │ │ │ ├── LoopingAudio.jpg │ │ │ │ ├── QuickReply.jpg │ │ │ │ ├── RS1StyleToast.jpg │ │ │ │ ├── SystemSnoozeAndDismiss.jpg │ │ │ │ ├── UnderConstruction.jpg │ │ │ │ └── WeatherToast.jpg │ │ ├── SmallLogo.scale-100.png │ │ ├── SplashScreen.scale-100.png │ │ ├── StoreLogo.scale-100.png │ │ ├── WideLogo.scale-100.png │ │ └── next.png │ ├── LICENSE │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── NotificationsExtensions.SampleApp.csproj │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── TilesPage.xaml │ ├── TilesPage.xaml.cs │ ├── ToastsPage.xaml │ ├── ToastsPage.xaml.cs │ ├── XboxModernTile.cs │ └── project.json ├── NotificationsExtensions.SampleJavascriptApp │ ├── LICENSE │ ├── NotificationsExtensions.SampleJavascriptApp.jsproj │ ├── WinJS │ │ ├── css │ │ │ ├── ui-dark.css │ │ │ └── ui-light.css │ │ ├── fonts │ │ │ └── Symbols.ttf │ │ └── js │ │ │ ├── WinJS.intellisense-setup.js │ │ │ ├── WinJS.intellisense.js │ │ │ ├── WinJS.js │ │ │ └── en-US │ │ │ └── ui.strings.js │ ├── css │ │ └── default.css │ ├── default.html │ ├── images │ │ ├── logo.scale-100.png │ │ ├── smalllogo.scale-100.png │ │ ├── splashscreen.scale-100.png │ │ └── storelogo.scale-100.png │ ├── js │ │ └── default.js │ ├── package.appxmanifest │ └── project.json ├── NotificationsExtensions.Test │ ├── AssertHelper.cs │ ├── LICENSE │ ├── NotificationsExtensions.Test.projitems │ ├── NotificationsExtensions.Test.shproj │ ├── TestMail.cs │ ├── TestMailLegacy.cs │ ├── TestWeather.cs │ ├── TestWeatherLegacy.cs │ ├── Test_Adaptive_Xml.cs │ ├── Test_Badge_Xml.cs │ ├── Test_Tile_Xml.cs │ ├── Test_ToastV2_Xml.cs │ ├── Test_Toast_Xml.cs │ ├── TextXboxModern.cs │ └── TextXboxModernLegacy.cs ├── NotificationsExtensions.WIn10.Test.NETCore │ ├── LICENSE │ ├── NotificationsExtensions.Win10.Test.NETCore.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── project.json ├── NotificationsExtensions.Win10.JavaScript.nuspec ├── NotificationsExtensions.Win10.JavaScript.targets ├── NotificationsExtensions.Win10.NETCore │ ├── LICENSE │ ├── NotificationsExtensions.Win10.NETCore.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── project.json ├── NotificationsExtensions.Win10.Portable │ ├── LICENSE │ ├── NotificationsExtensions.Win10.Portable.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── README.md ├── NotificationsExtensions.Win10.Test.Portable │ ├── LICENSE │ ├── NotificationsExtensions.Win10.Test.Portable.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── NotificationsExtensions.Win10.UWP │ ├── NotificationsExtensions.Win10.UWP.csproj │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── NotificationsExtensions.Win10.UWP.rd.xml │ └── project.json ├── NotificationsExtensions.Win10.WinRT │ ├── LICENSE │ ├── NotificationsExtensions.Win10.WinRT.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── project.json ├── NotificationsExtensions.Win10.native.targets ├── NotificationsExtensions.Win10.nuspec ├── NotificationsExtensions.Win10.sln ├── NotificationsExtensions │ ├── Adaptive │ │ ├── AdaptiveGroup.cs │ │ ├── AdaptiveHelper.cs │ │ ├── AdaptiveImage.cs │ │ ├── AdaptiveImageEnums.cs │ │ ├── AdaptiveSubgroup.cs │ │ ├── AdaptiveSubgroupEnums.cs │ │ ├── AdaptiveText.cs │ │ ├── AdaptiveTextEnums.cs │ │ ├── BaseImageHelper.cs │ │ ├── BaseTextHelper.cs │ │ ├── ChildrenInterfaces.cs │ │ ├── Elements │ │ │ ├── Element_AdaptiveGroup.cs │ │ │ ├── Element_AdaptiveImage.cs │ │ │ ├── Element_AdaptiveImageEnums.cs │ │ │ ├── Element_AdaptiveSubgroup.cs │ │ │ └── Element_AdaptiveText.cs │ │ ├── IAdaptiveCollection.cs │ │ ├── IBaseImage.cs │ │ └── IBaseText.cs │ ├── Badges │ │ └── BadgeContent.cs │ ├── Common │ │ ├── Common.cs │ │ └── ContentInterfaces.cs │ ├── LICENSE │ ├── NotificationsExtensions.projitems │ ├── NotificationsExtensions.shproj │ ├── Tiles │ │ ├── Adaptive │ │ │ ├── Common.cs │ │ │ ├── TileBindingContentAdaptive.cs │ │ │ ├── TileGroup.cs │ │ │ ├── TileImage.cs │ │ │ ├── TileSubgroup.cs │ │ │ ├── TileText.cs │ │ │ ├── TileTextAlign.cs │ │ │ └── TileTextStyle.cs │ │ ├── Common.cs │ │ ├── Elements │ │ │ ├── Common.cs │ │ │ ├── Element_Tile.cs │ │ │ ├── Element_TileBinding.cs │ │ │ ├── Element_TileGroup.cs │ │ │ ├── Element_TileImage.cs │ │ │ ├── Element_TileSubgroup.cs │ │ │ ├── Element_TileText.cs │ │ │ └── Element_TileVisual.cs │ │ ├── SpecialTemplates │ │ │ ├── TileBindingContentContact.cs │ │ │ ├── TileBindingContentIconic.cs │ │ │ ├── TileBindingContentPeople.cs │ │ │ └── TileBindingContentPhotos.cs │ │ ├── TileBasicText.cs │ │ ├── TileBinding.cs │ │ ├── TileBranding.cs │ │ ├── TileContent.cs │ │ ├── TileImageSource.cs │ │ ├── TileTemplateNameV1.cs │ │ ├── TileTemplateNameV3.cs │ │ └── TileVisual.cs │ └── Toasts │ │ ├── Common.cs │ │ ├── Elements │ │ ├── Element_Toast.cs │ │ ├── Element_ToastAction.cs │ │ ├── Element_ToastActions.cs │ │ ├── Element_ToastAudio.cs │ │ ├── Element_ToastBinding.cs │ │ ├── Element_ToastImage.cs │ │ ├── Element_ToastInput.cs │ │ ├── Element_ToastSelection.cs │ │ ├── Element_ToastText.cs │ │ └── Element_ToastVisual.cs │ │ ├── ToastActions.cs │ │ ├── ToastAppLogo.cs │ │ ├── ToastAppLogoEnums.cs │ │ ├── ToastAudio.cs │ │ ├── ToastBindingGeneric.cs │ │ ├── ToastButton.cs │ │ ├── ToastContent.cs │ │ ├── ToastContextMenuItem.cs │ │ ├── ToastGenericAppLogo.cs │ │ ├── ToastGenericAppLogoEnums.cs │ │ ├── ToastGenericAttributionText.cs │ │ ├── ToastGenericHeroImage.cs │ │ ├── ToastImage.cs │ │ ├── ToastImageSource.cs │ │ ├── ToastSelectionBox.cs │ │ ├── ToastSelectionBoxItem.cs │ │ ├── ToastText.cs │ │ ├── ToastTextBox.cs │ │ └── ToastVisual.cs └── README.md └── Windows 8.1 RT ├── LICENSE ├── NotificationsExtensions.WinRT.sln ├── NotificationsExtensions.WinRT ├── BadgeContent │ └── BadgeContent.cs ├── Common.cs ├── ContentInterfaces.cs ├── LICENSE ├── NotificationsExtensions.WinRT.csproj ├── Properties │ └── AssemblyInfo.cs ├── TileContent │ └── TileContent.cs └── ToastContent │ └── ToastContent.cs └── README.md /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | NotificationsExtensions is written by Microsoft, but we're glad to have you help contribute to the library! There are three ways to contribute... 4 | 5 | - Report bugs (open a new issue) 6 | - Request features (open a new issue) 7 | - Fix bugs/add features (open a pull request) 8 | 9 | 10 | ## Reporting Bugs 11 | 12 | If you find a bug in the library, go to the Issues section of the GitHub, and create a new issue. Label it as "bug". 13 | 14 | 15 | ## Requesting Features 16 | 17 | Have a suggestion of how the library could be improved? A new method? New types? Whatever it is, go to the Issues section of the GitHub, create a new issue, and label it "request". 18 | 19 | 20 | ## Fixing Bugs / Adding Features (pull requests) 21 | 22 | If you'd like to fix something in the code, or add new features to the code, here's the requirements... 23 | 24 | 1. Your modification needs to fit within the goals listed on the Wiki's home page 25 | 2. You need to add or modify tests to make sure your change is thoroughly tested (the test projects use shared code so that there can be a NETCore test project and a Portable test project, make sure your test works in both) 26 | 3. Run all the tests (including your new ones) and ensure they all pass 27 | 4. Follow the coding style of the original source code 28 | 5. If your changes affect the public API, make sure all summaries on classes/methods/properties are properly updated so that users of the API can understand what the API does via IntelliSense 29 | 6. DO NOT BREAK THE PUBLIC API SURFACE, we do not want to break the API for existing devs using the library. Over time we might have to depreciate things, but in general we should try to ensure that devs can simply update the library without worrying that their code won't compile after the update. 30 | 31 | I will still have the final say deciding which requests get added. If you're worried I might reject a request, talk to me before hand. If you're proposing adding a new property, for example, I might disagree that the property should be added. Thus, it would save your time if you simply asked me first, before coding it up. A good way to ask me would be to open a new feature request issue, state what your feature would do, state that you're willing to code it up, and ask me if I'll accept the pull request. Then you can code it and send the pull request. 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THIS PROJECT HAS MOVED 2 | 3 | ### NotificationsExtensions is now part of the [UWP Community Toolkit](https://github.com/Microsoft/UWPCommunityToolkit). Please find the latest version [here](https://github.com/Microsoft/UWPCommunityToolkit). 4 | 5 | # NotificationsExtensions 6 | 7 | The official Microsoft NotificationsExtensions library. Generate tile, toast, and badge notifications for Windows via code, with the help of IntelliSense, instead of directly using XML. 8 | 9 | **Supports adaptive tiles and adaptive/interactive toast notifications for Windows 10!** 10 | 11 | ## Getting Started 12 | 13 | 1. Clone this repository to your local hard drive 14 | 2. Open your own project (Windows 10 app, server code, etc) 15 | 3. **If you're writing a Windows 10 app, reference "Windows 10" -> "NotificationsExtensions.Win10.WinRT"** 16 | 4. If you're writing a server app (non-WinRT), reference "Windows 10" -> "NotificationsExtensions.Win10.Portable" 17 | 5. After the project is referenced, the namespace is "NotificationsExtensions" and each category of notifications are under their own namespace like "NotificationsExtensions.Tiles" or "Toasts" or "Badges". 18 | 19 | 20 | ## How to use it 21 | 22 | Please [read our Wiki](https://github.com/anbare/NotificationsExtensions/wiki) to learn how to use NotificationsExtensions. 23 | 24 | 25 | 26 | ## Fine Print 27 | 28 | This project has adopted the [Microsoft Open Source Code of Conduct](http://microsoft.github.io/codeofconduct). For more information see the [Code of Conduct FAQ](http://microsoft.github.io/codeofconduct/faq.md) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 29 | -------------------------------------------------------------------------------- /Wiki/Tiles/GroupsAndSubgroups/GroupsDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Wiki/Tiles/GroupsAndSubgroups/GroupsDesktop.png -------------------------------------------------------------------------------- /Wiki/Tiles/GroupsAndSubgroups/GroupsTablet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Wiki/Tiles/GroupsAndSubgroups/GroupsTablet.png -------------------------------------------------------------------------------- /Windows 10/GenerateNugetPackage.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set files=NotificationsExtensions.Win10.Portable\bin\Release\NotificationsExtensions.Win10.dll 4 | set files=%files% NotificationsExtensions.Win10.Portable\bin\Release\NotificationsExtensions.Win10.pdb 5 | set files=%files% NotificationsExtensions.Win10.Portable\bin\Release\NotificationsExtensions.Win10.xml 6 | 7 | set files=%files% NotificationsExtensions.Win10.WinRT\bin\Release\NotificationsExtensions.winmd 8 | set files=%files% NotificationsExtensions.Win10.WinRT\bin\Release\NotificationsExtensions.pri 9 | set files=%files% NotificationsExtensions.Win10.WinRT\bin\Release\NotificationsExtensions.pdb 10 | set files=%files% NotificationsExtensions.Win10.WinRT\bin\Release\NotificationsExtensions.xml 11 | 12 | set files=%files% NotificationsExtensions.Win10.NETCore\bin\Release\NotificationsExtensions.Win10.dll 13 | set files=%files% NotificationsExtensions.Win10.NETCore\bin\Release\NotificationsExtensions.Win10.pdb 14 | set files=%files% NotificationsExtensions.Win10.NETCore\bin\Release\NotificationsExtensions.Win10.xml 15 | 16 | set files=%files% NotificationsExtensions.Win10.UWP\bin\Release\NotificationsExtensions.Win10.dll 17 | set files=%files% NotificationsExtensions.Win10.UWP\bin\Release\NotificationsExtensions.Win10.pdb 18 | set files=%files% NotificationsExtensions.Win10.UWP\bin\Release\NotificationsExtensions.Win10.xml 19 | 20 | FOR %%f IN (%files%) DO IF NOT EXIST %%f call :file_not_found %%f 21 | 22 | 23 | echo Here are the current timestamps on the DLL's... 24 | echo. 25 | 26 | FOR %%f IN (%files%) DO ECHO %%~tf %%f 27 | 28 | echo. 29 | 30 | PAUSE 31 | 32 | 33 | 34 | echo Welcome, let's create a new NuGet package for NotificationsExtensions.Win10! 35 | echo. 36 | 37 | set /p version="Enter Version Number (ex. 10240.0.0): " 38 | 39 | if not exist "..\NugetPackages" mkdir "..\NugetPackages" 40 | 41 | "C:\Program Files (x86)\NuGet\nuget.exe" pack NotificationsExtensions.Win10.nuspec -Version %version% -OutputDirectory "..\NugetPackages" 42 | 43 | "C:\Program Files (x86)\NuGet\nuget.exe" pack NotificationsExtensions.Win10.JavaScript.nuspec -Version %version% -OutputDirectory "..\NugetPackages" 44 | 45 | PAUSE 46 | 47 | explorer ..\NugetPackages 48 | 49 | 50 | 51 | 52 | exit 53 | :file_not_found 54 | 55 | echo File not found: %1 56 | PAUSE 57 | exit 58 | -------------------------------------------------------------------------------- /Windows 10/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Cloudy-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Cloudy-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Cloudy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Cloudy.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Drizzle-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Drizzle-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Drizzle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Drizzle.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Haze-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Haze-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Haze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Haze.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy-Background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy-Background.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Mostly Cloudy.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Slight Drizzle-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Slight Drizzle-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Slight Drizzle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Slight Drizzle.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Snow-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Snow-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Snow.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Sunny-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Sunny-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Sunny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Sunny.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Thunderstorms-Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Thunderstorms-Square.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Thunderstorms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Apps/Weather/Thunderstorms.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Images/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Images/map.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/CirclePeek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/CirclePeek.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/HeavyOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/HeavyOverlay.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/PeekAndBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/PeekAndBackground.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/PeekOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Tiles/PeekOverlay.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/CustomSnoozeAndDismissText.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/CustomSnoozeAndDismissText.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/CustomSnoozeTimes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/CustomSnoozeTimes.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/LoopingAudio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/LoopingAudio.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/QuickReply.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/QuickReply.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/RS1StyleToast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/RS1StyleToast.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/SystemSnoozeAndDismiss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/SystemSnoozeAndDismiss.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/UnderConstruction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/UnderConstruction.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/WeatherToast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/Samples/Toasts/WeatherToast.jpg -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/WideLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/WideLogo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/Assets/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleApp/Assets/next.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleApp/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/images/logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleJavascriptApp/images/logo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/images/smalllogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleJavascriptApp/images/smalllogo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/images/splashscreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleJavascriptApp/images/splashscreen.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/images/storelogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions.SampleJavascriptApp/images/storelogo.scale-100.png -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/js/default.js: -------------------------------------------------------------------------------- 1 | // For an introduction to the Blank template, see the following documentation: 2 | // http://go.microsoft.com/fwlink/?LinkId=232509 3 | (function () { 4 | "use strict"; 5 | 6 | var app = WinJS.Application; 7 | var activation = Windows.ApplicationModel.Activation; 8 | 9 | app.onactivated = function (args) { 10 | if (args.detail.kind === activation.ActivationKind.launch) { 11 | if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { 12 | // TODO: This application has been newly launched. Initialize your application here. 13 | } else { 14 | // TODO: This application has been reactivated from suspension. 15 | // Restore application state here. 16 | } 17 | args.setPromise(WinJS.UI.processAll()); 18 | 19 | var buttonUpdateTile = document.getElementById("buttonUpdateTile"); 20 | buttonUpdateTile.addEventListener("click", updateTile, false); 21 | 22 | } 23 | }; 24 | 25 | app.oncheckpoint = function (args) { 26 | // TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here. 27 | // You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension. 28 | // If you need to complete an asynchronous operation before your application is suspended, call args.setPromise(). 29 | }; 30 | 31 | 32 | function updateTile(eventInfo) { 33 | 34 | 35 | //var tileContent = NotificationsExtensions.TileContent.TileContentFactory.createTileSquareText02(); 36 | //tileContent.textHeading.text = "Notification"; 37 | //tileContent.textBodyWrap.text = Date().toString(); 38 | 39 | //Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().update(new Windows.UI.Notifications.TileNotification(tileContent.getXml())); 40 | 41 | 42 | 43 | var small = NotificationsExtensions.TileContentFactory.adaptive.createSmall(); 44 | 45 | var text = new NotificationsExtensions.TileText(); 46 | text.source = new NotificationsExtensions.TileTextSource("Hello world"); 47 | text.wrap = true; 48 | text.minLines = 2; 49 | text.maxLines = 2; 50 | 51 | small.children.append(text); 52 | 53 | 54 | 55 | var tile = new NotificationsExtensions.TileContent(); 56 | 57 | tile.visual.largeTile = "What the fuck"; 58 | 59 | var messageDialog = new Windows.UI.Popups.MessageDialog("Success"); 60 | messageDialog.showAsync(); 61 | } 62 | 63 | app.start(); 64 | })(); 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | NotificationsExtensions.SampleJavascriptApp 17 | anbare 18 | images\storelogo.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.SampleJavascriptApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": { } 7 | }, 8 | "runtimes": { 9 | "win10-arm": { }, 10 | "win10-arm-aot": { }, 11 | "win10-x86": { }, 12 | "win10-x86-aot": { }, 13 | "win10-x64": { }, 14 | "win10-x64-aot": { } 15 | } 16 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Test/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Test/NotificationsExtensions.Test.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 6672bcc5-ffe8-4fdf-a982-9d4840f70678 7 | 8 | 9 | NotificationsExtensions.Test 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Test/NotificationsExtensions.Test.shproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 6672bcc5-ffe8-4fdf-a982-9d4840f70678 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Test/Test_Badge_Xml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using NotificationsExtensions.Badges; 3 | 4 | namespace NotificationsExtensions.Win10.Test.Portable 5 | { 6 | [TestClass] 7 | public class Test_Badge_Xml 8 | { 9 | [TestMethod] 10 | public void Test_Badge_Xml_Numeric_0() 11 | { 12 | AssertBadgeValue("0", new BadgeNumericNotificationContent(0)); 13 | } 14 | 15 | [TestMethod] 16 | public void Test_Badge_Xml_Numeric_1() 17 | { 18 | AssertBadgeValue("1", new BadgeNumericNotificationContent(1)); 19 | } 20 | 21 | [TestMethod] 22 | public void Test_Badge_Xml_Numeric_2() 23 | { 24 | AssertBadgeValue("2", new BadgeNumericNotificationContent(2)); 25 | } 26 | 27 | [TestMethod] 28 | public void Test_Badge_Xml_Numeric_546() 29 | { 30 | AssertBadgeValue("546", new BadgeNumericNotificationContent(546)); 31 | } 32 | 33 | [TestMethod] 34 | public void Test_Badge_Xml_Numeric_Max() 35 | { 36 | AssertBadgeValue(uint.MaxValue.ToString(), new BadgeNumericNotificationContent(uint.MaxValue)); 37 | } 38 | 39 | [TestMethod] 40 | public void Test_Badge_Xml_Glyph_None() 41 | { 42 | AssertBadgeValue("none", new BadgeGlyphNotificationContent(GlyphValue.None)); 43 | } 44 | 45 | [TestMethod] 46 | public void Test_Badge_Xml_Glyph_Alert() 47 | { 48 | AssertBadgeValue("alert", new BadgeGlyphNotificationContent(GlyphValue.Alert)); 49 | } 50 | 51 | [TestMethod] 52 | public void Test_Badge_Xml_Glyph_Error() 53 | { 54 | AssertBadgeValue("error", new BadgeGlyphNotificationContent(GlyphValue.Error)); 55 | } 56 | 57 | private static void AssertBadgeValue(string expectedValue, INotificationContent notificationContent) 58 | { 59 | AssertPayload("", notificationContent); 60 | } 61 | 62 | private static void AssertPayload(string expectedXml, INotificationContent notificationContent) 63 | { 64 | AssertHelper.AssertXml(expectedXml, notificationContent.GetContent()); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.WIn10.Test.NETCore/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.WIn10.Test.NETCore/NotificationsExtensions.Win10.Test.NETCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 14.0 6 | Debug 7 | AnyCPU 8 | {2135EDD4-3C9F-4F3B-8040-96D4449FB1D8} 9 | Library 10 | Properties 11 | NotificationsExtensions.Win10.Test.NETCore 12 | NotificationsExtensions.Win10.Test.NETCore 13 | en-US 14 | 512 15 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | 17 | 18 | v5.0 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 50 | 51 | 52 | 53 | 54 | {d904d8c8-aec5-440b-b80e-d42ff3b91ede} 55 | NotificationsExtensions.Win10.NETCore 56 | 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.WIn10.Test.NETCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("NotificationsExtensions.WIn10.Test.NETCore")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("NotificationsExtensions.WIn10.Test.NETCore")] 14 | [assembly: AssemblyCopyright("Copyright © 2015")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.WIn10.Test.NETCore/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "supports": { 3 | "net46.app": {}, 4 | "uwp.10.0.app": {}, 5 | "dnxcore50.app": {} 6 | }, 7 | "dependencies": { 8 | "Microsoft.NETCore": "5.0.0", 9 | "Microsoft.NETCore.Portable.Compatibility": "1.0.0" 10 | }, 11 | "frameworks": { 12 | "dotnet": { 13 | "imports": "portable-net452+win81" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.JavaScript.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NotificationsExtensions.Win10.JavaScript 5 | 0.0.0 6 | Microsoft 7 | microsoft, andrewbares 8 | https://github.com/anbare/NotificationsExtensions/wiki 9 | false 10 | Generate tile, toast, and badge notifications for Windows 10 via code, with the help of IntelliSense, instead of directly using XML. 11 | The official NotificationsExtensions library from Microsoft. Supports JavaScript UWP projects (see NotificationsExtensions.Win10 for the C#/C++ version). 12 | 13 | Generate tile, toast, and badge notifications for Windows 10 via code, with the help of IntelliSense, instead of directly using XML. 14 | 15 | Supports adaptive tiles and adaptive/interactive toasts for Windows 10! 16 | © Microsoft Corporation. All rights reserved. 17 | notifications, win10, windows 10, tile, tiles, toast, toasts, badge, xml, uwp, javascript 18 | https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/master/LICENSE 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.JavaScript.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(MSBuildThisFileDirectory)..\..\lib\Windows\NotificationsExtensions.winmd 7 | true 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.NETCore/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.NETCore/NotificationsExtensions.Win10.NETCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 14.0 6 | Debug 7 | AnyCPU 8 | {D904D8C8-AEC5-440B-B80E-D42FF3B91EDE} 9 | Library 10 | Properties 11 | NotificationsExtensions 12 | NotificationsExtensions.Win10 13 | en-US 14 | 512 15 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | 17 | 18 | v5.0 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | TRACE;DEBUG;NETFX_CORE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE;NETFX_CORE 34 | prompt 35 | 4 36 | bin\Release\NotificationsExtensions.Win10.xml 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.NETCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("NotificationsExtensions.Win10")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("NotificationsExtensions.Win10")] 14 | [assembly: AssemblyCopyright("Copyright © 2015")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.NETCore/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "supports": { 3 | "net46.app": {}, 4 | "uwp.10.0.app": {}, 5 | "dnxcore50.app": {} 6 | }, 7 | "dependencies": { 8 | "Microsoft.NETCore": "5.0.0", 9 | "Microsoft.NETCore.Portable.Compatibility": "1.0.0" 10 | }, 11 | "frameworks": { 12 | "dotnet": { 13 | "imports": "portable-net452+win81" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Portable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Portable/NotificationsExtensions.Win10.Portable.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 10.0 6 | Debug 7 | AnyCPU 8 | {DF77CE61-4633-49EC-90B1-DEBE0ED19EB6} 9 | Library 10 | Properties 11 | NotificationsExtensions 12 | NotificationsExtensions.Win10 13 | en-US 14 | 512 15 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | Profile344 17 | v4.0 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | TRACE;DEBUG 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | bin\Release\NotificationsExtensions.Win10.xml 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 49 | 50 | 57 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Portable/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("NotificationsExtensions.Win10")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("NotificationsExtensions.Win10")] 14 | [assembly: AssemblyCopyright("Copyright © 2015")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Portable/README.md: -------------------------------------------------------------------------------- 1 | ### NotificationsExtensions for Windows 10 - Portable Project 2 | 3 | This is the Portable class library version of NotificationsExtensions. It can be used on your server and in your Windows 10 app. It does not include any references to the WinRT API. If you're strictly using NotificationsExtensions in a Windows 10 app, I recommend downloading the WinRT version. 4 | 5 | These projects use shared files so that they share the same source code (using #IF for WinRT code). 6 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Test.Portable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.Test.Portable/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NotificationsExtensions.Win10.Test.Portable")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NotificationsExtensions.Win10.Test.Portable")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c4518f16-3500-4021-8b19-f1b1fd3b0815")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NotificationsExtensions.Win10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NotificationsExtensions.Win10")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.UWP/Properties/NotificationsExtensions.Win10.UWP.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": { }, 10 | "win10-arm-aot": { }, 11 | "win10-x86": { }, 12 | "win10-x86-aot": { }, 13 | "win10-x64": { }, 14 | "win10-x64-aot": { } 15 | } 16 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.WinRT/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.WinRT/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NotificationsExtensions.Win10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NotificationsExtensions.Win10")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.WinRT/README.md: -------------------------------------------------------------------------------- 1 | ### NotificationsExtensions for Windows 10 - WinRT Project 2 | 3 | This is the WinRT class library version of NotificationsExtensions. It can only be used in your Windows 10 app, since it has references to the WinRT API. If you want to use NotificationsExtensions on your server, reference the Portable version. 4 | 5 | These projects use shared files so that they share the same source code (using #IF for WinRT code). 6 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.WinRT/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": { } 7 | }, 8 | "runtimes": { 9 | "win10-arm": { }, 10 | "win10-arm-aot": { }, 11 | "win10-x86": { }, 12 | "win10-x86-aot": { }, 13 | "win10-x64": { }, 14 | "win10-x64-aot": { } 15 | } 16 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions.Win10.native.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(MSBuildThisFileDirectory)..\..\lib\native\NotificationsExtensions.winmd 7 | true 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveGroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using NotificationsExtensions.Tiles; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions 15 | { 16 | /// 17 | /// Groups semantically identify that the content in the group must either be displayed as a whole, or not displayed if it cannot fit. Groups also allow creating multiple columns. 18 | /// 19 | public sealed class AdaptiveGroup : IAdaptiveChild, ITileAdaptiveChild 20 | { 21 | /// 22 | /// Initializes a new group. Groups semantically identify that the content in the group must either be displayed as a whole, or not displayed if it cannot fit. Groups also allow creating multiple columns. 23 | /// 24 | public AdaptiveGroup() { } 25 | 26 | /// 27 | /// The only valid children of groups are . Each subgroup is displayed as a separate vertical column. Note that you must include at least one subgroup in your group, otherwise an will be thrown when you try to retrieve the XML for the notification. 28 | /// 29 | public IList Children { get; private set; } = new List(); 30 | 31 | internal Element_AdaptiveGroup ConvertToElement() 32 | { 33 | if (Children.Count == 0) 34 | throw new InvalidOperationException("Groups must have at least one child subgroup. The Children property had zero items in it."); 35 | 36 | Element_AdaptiveGroup group = new Element_AdaptiveGroup(); 37 | 38 | foreach (var subgroup in Children) 39 | group.Children.Add(subgroup.ConvertToElement()); 40 | 41 | return group; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveHelper.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | using System.Linq; 12 | 13 | namespace NotificationsExtensions.Adaptive 14 | { 15 | internal static class AdaptiveHelper 16 | { 17 | internal static object ConvertToElement(object obj) 18 | { 19 | if (obj is AdaptiveText) 20 | return (obj as AdaptiveText).ConvertToElement(); 21 | 22 | else if (obj is AdaptiveImage) 23 | return (obj as AdaptiveImage).ConvertToElement(); 24 | 25 | else if (obj is AdaptiveGroup) 26 | return (obj as AdaptiveGroup).ConvertToElement(); 27 | 28 | else if (obj is AdaptiveSubgroup) 29 | return (obj as AdaptiveSubgroup).ConvertToElement(); 30 | 31 | else 32 | throw new NotImplementedException("Unknown object: " + obj.GetType()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using NotificationsExtensions.Tiles; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions 15 | { 16 | /// 17 | /// An inline image. 18 | /// 19 | public sealed class AdaptiveImage : IBaseImage, IAdaptiveChild, IAdaptiveSubgroupChild, ITileAdaptiveChild 20 | { 21 | /// 22 | /// Initializes a new inline image. 23 | /// 24 | public AdaptiveImage() { } 25 | 26 | /// 27 | /// Control the desired cropping of the image. 28 | /// 29 | public AdaptiveImageCrop HintCrop { get; set; } 30 | 31 | /// 32 | /// By default, images have an 8px margin around them. You can remove this margin by setting this property to true. 33 | /// 34 | public bool? HintRemoveMargin { get; set; } 35 | 36 | /// 37 | /// The horizontal alignment of the image. 38 | /// 39 | public AdaptiveImageAlign HintAlign { get; set; } 40 | 41 | private string _source; 42 | /// 43 | /// Required. The URI of the image. Can be from your application package, application data, or the internet. Internet images must be less than 200 KB in size. 44 | /// 45 | public string Source 46 | { 47 | get { return _source; } 48 | set { BaseImageHelper.SetSource(ref _source, value); } 49 | } 50 | 51 | /// 52 | /// A description of the image, for users of assistive technologies. 53 | /// 54 | public string AlternateText { get; set; } 55 | 56 | /// 57 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 58 | /// 59 | public bool? AddImageQuery { get; set;} 60 | 61 | internal Element_AdaptiveImage ConvertToElement() 62 | { 63 | Element_AdaptiveImage image = BaseImageHelper.CreateBaseElement(this); 64 | 65 | image.Crop = HintCrop; 66 | image.RemoveMargin = HintRemoveMargin; 67 | image.Align = HintAlign; 68 | image.Placement = AdaptiveImagePlacement.Inline; 69 | 70 | return image; 71 | } 72 | 73 | /// 74 | /// Returns the image's source string. 75 | /// 76 | /// 77 | public override string ToString() 78 | { 79 | if (Source == null) 80 | return "Source is null"; 81 | 82 | return Source; 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveImageEnums.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions 13 | { 14 | /// 15 | /// Specifies the horizontal alignment for an image. 16 | /// 17 | public enum AdaptiveImageAlign 18 | { 19 | /// 20 | /// Default value, alignment behavior determined by renderer. 21 | /// 22 | Default, 23 | 24 | /// 25 | /// Image stretches to fill available width (and potentially available height too, depending on where the image is). 26 | /// 27 | [EnumString("stretch")] 28 | Stretch, 29 | 30 | /// 31 | /// Align the image to the left, displaying the image at its native resolution. 32 | /// 33 | [EnumString("left")] 34 | Left, 35 | 36 | /// 37 | /// Align the image in the center horizontally, displaying the image at its native resolution. 38 | /// 39 | [EnumString("center")] 40 | Center, 41 | 42 | /// 43 | /// Align the image to the right, displaying the image at its native resolution. 44 | /// 45 | [EnumString("right")] 46 | Right 47 | } 48 | 49 | /// 50 | /// Specify the desired cropping of the image. 51 | /// 52 | public enum AdaptiveImageCrop 53 | { 54 | /// 55 | /// Default value, cropping behavior determined by renderer. 56 | /// 57 | Default, 58 | 59 | /// 60 | /// Image is not cropped. 61 | /// 62 | [EnumString("none")] 63 | None, 64 | 65 | /// 66 | /// Image is cropped to a circle shape. 67 | /// 68 | [EnumString("circle")] 69 | Circle 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveSubgroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | 13 | namespace NotificationsExtensions 14 | { 15 | /// 16 | /// Subgroups are vertical columns that can contain text and images. 17 | /// 18 | public sealed class AdaptiveSubgroup 19 | { 20 | /// 21 | /// Initializes a new subgroup. Subgroups are vertical columns that can contain text and images. 22 | /// 23 | public AdaptiveSubgroup() { } 24 | 25 | /// 26 | /// and are valid children of subgroups. 27 | /// 28 | public IList Children { get; private set; } = new List(); 29 | 30 | private int? _hintWeight; 31 | 32 | /// 33 | /// Control the width of this subgroup column by specifying the weight, relative to the other subgroups. 34 | /// 35 | public int? HintWeight 36 | { 37 | get { return _hintWeight; } 38 | set 39 | { 40 | Element_AdaptiveSubgroup.CheckWeight(value); 41 | 42 | _hintWeight = value; 43 | } 44 | } 45 | 46 | /// 47 | /// Control the vertical alignment of this subgroup's content. 48 | /// 49 | public AdaptiveSubgroupTextStacking HintTextStacking { get; set; } = Element_AdaptiveSubgroup.DEFAULT_TEXT_STACKING; 50 | 51 | internal Element_AdaptiveSubgroup ConvertToElement() 52 | { 53 | var subgroup = new Element_AdaptiveSubgroup() 54 | { 55 | Weight = HintWeight, 56 | TextStacking = HintTextStacking 57 | }; 58 | 59 | foreach (var child in Children) 60 | { 61 | subgroup.Children.Add(ConvertToSubgroupChildElement(child)); 62 | } 63 | 64 | return subgroup; 65 | } 66 | 67 | private static IElement_AdaptiveSubgroupChild ConvertToSubgroupChildElement(IAdaptiveSubgroupChild child) 68 | { 69 | if (child is AdaptiveText) 70 | return (child as AdaptiveText).ConvertToElement(); 71 | 72 | else if (child is AdaptiveImage) 73 | return (child as AdaptiveImage).ConvertToElement(); 74 | 75 | else 76 | throw new NotImplementedException("Unknown child: " + child.GetType()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/AdaptiveSubgroupEnums.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions 13 | { 14 | 15 | /// 16 | /// TextStacking specifies the vertical alignment of content. 17 | /// 18 | public enum AdaptiveSubgroupTextStacking 19 | { 20 | /// 21 | /// Renderer automatically selects the default vertical alignment. 22 | /// 23 | Default, 24 | 25 | /// 26 | /// Vertical align to the top. 27 | /// 28 | [EnumString("top")] 29 | Top, 30 | 31 | /// 32 | /// Vertical align to the center. 33 | /// 34 | [EnumString("center")] 35 | Center, 36 | 37 | /// 38 | /// Vertical align to the bottom. 39 | /// 40 | [EnumString("bottom")] 41 | Bottom 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/BaseImageHelper.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | 13 | namespace NotificationsExtensions 14 | { 15 | internal static class BaseImageHelper 16 | { 17 | internal static void SetSource(ref string destination, string value) 18 | { 19 | if (value == null) 20 | throw new ArgumentNullException("Source property cannot be null."); 21 | 22 | destination = value; 23 | } 24 | 25 | internal static Element_AdaptiveImage CreateBaseElement(IBaseImage curr) 26 | { 27 | if (curr.Source == null) 28 | throw new NullReferenceException("Source property is required."); 29 | 30 | return new Element_AdaptiveImage() 31 | { 32 | Src = curr.Source, 33 | Alt = curr.AlternateText, 34 | AddImageQuery = curr.AddImageQuery 35 | }; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/BaseTextHelper.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | 13 | namespace NotificationsExtensions 14 | { 15 | internal class BaseTextHelper 16 | { 17 | internal static Element_AdaptiveText CreateBaseElement(IBaseText curr) 18 | { 19 | return new Element_AdaptiveText() 20 | { 21 | Text = curr.Text, 22 | Lang = curr.Language 23 | }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/ChildrenInterfaces.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Tiles; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | 13 | namespace NotificationsExtensions 14 | { 15 | /// 16 | /// Elements that can be direct children of adaptive content, including (, , and ). 17 | /// 18 | public interface IAdaptiveChild : ITileAdaptiveChild 19 | { 20 | // Blank interface simply for compile-enforcing the child types in the list. 21 | 22 | 23 | } 24 | 25 | /// 26 | /// Elements that can be direct children of an , including ( and ). 27 | /// 28 | public interface IAdaptiveSubgroupChild 29 | { 30 | // Blank interface simply for compile-enforcing the child types in the list. 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/Elements/Element_AdaptiveGroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Tiles; 9 | using NotificationsExtensions.Toasts; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions.Adaptive.Elements 15 | { 16 | 17 | [NotificationXmlElement("group")] 18 | internal sealed class Element_AdaptiveGroup : IElement_TileBindingChild, IElement_ToastBindingChild, IElementWithDescendants 19 | { 20 | public IList Children { get; private set; } = new List(); 21 | 22 | public IEnumerable Descendants() 23 | { 24 | foreach (Element_AdaptiveSubgroup subgroup in Children) 25 | { 26 | // Return the subgroup 27 | yield return subgroup; 28 | 29 | // And also return its descendants 30 | foreach (object descendant in subgroup.Descendants()) 31 | yield return descendant; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/Elements/Element_AdaptiveImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Tiles; 9 | using NotificationsExtensions.Toasts; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions.Adaptive.Elements 15 | { 16 | [NotificationXmlElement("image")] 17 | internal sealed class Element_AdaptiveImage : IElement_TileBindingChild, IElement_TileSubgroupChild, IElement_ToastBindingChild, IElement_AdaptiveSubgroupChild 18 | { 19 | internal const AdaptiveImagePlacement DEFAULT_PLACEMENT = AdaptiveImagePlacement.Inline; 20 | internal const AdaptiveImageCrop DEFAULT_CROP = AdaptiveImageCrop.Default; 21 | internal const AdaptiveImageAlign DEFAULT_ALIGN = AdaptiveImageAlign.Default; 22 | 23 | [NotificationXmlAttribute("id")] 24 | public int? Id { get; set; } 25 | 26 | [NotificationXmlAttribute("src")] 27 | public string Src { get; set; } 28 | 29 | [NotificationXmlAttribute("alt")] 30 | public string Alt { get; set; } 31 | 32 | [NotificationXmlAttribute("addImageQuery")] 33 | public bool? AddImageQuery { get; set; } 34 | 35 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 36 | public AdaptiveImagePlacement Placement { get; set; } = DEFAULT_PLACEMENT; 37 | 38 | [NotificationXmlAttribute("hint-align", DEFAULT_ALIGN)] 39 | public AdaptiveImageAlign Align { get; set; } = DEFAULT_ALIGN; 40 | 41 | [NotificationXmlAttribute("hint-crop", DEFAULT_CROP)] 42 | public AdaptiveImageCrop Crop { get; set; } = DEFAULT_CROP; 43 | 44 | [NotificationXmlAttribute("hint-removeMargin")] 45 | public bool? RemoveMargin { get; set; } 46 | 47 | private int? _overlay; 48 | [NotificationXmlAttribute("hint-overlay")] 49 | public int? Overlay 50 | { 51 | get { return _overlay; } 52 | set 53 | { 54 | if (value != null) 55 | Element_TileBinding.CheckOverlayValue(value.Value); 56 | 57 | _overlay = value; 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/Elements/Element_AdaptiveImageEnums.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions.Adaptive.Elements 13 | { 14 | internal enum AdaptiveImagePlacement 15 | { 16 | [EnumString("inline")] 17 | Inline, 18 | 19 | [EnumString("background")] 20 | Background, 21 | 22 | [EnumString("peek")] 23 | Peek, 24 | 25 | [EnumString("hero")] 26 | Hero, 27 | 28 | [EnumString("appLogoOverride")] 29 | AppLogoOverride 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/Elements/Element_AdaptiveSubgroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Adaptive.Elements 12 | { 13 | [NotificationXmlElement("subgroup")] 14 | internal sealed class Element_AdaptiveSubgroup : IElementWithDescendants 15 | { 16 | internal const AdaptiveSubgroupTextStacking DEFAULT_TEXT_STACKING = AdaptiveSubgroupTextStacking.Default; 17 | 18 | [NotificationXmlAttribute("hint-textStacking", DEFAULT_TEXT_STACKING)] 19 | public AdaptiveSubgroupTextStacking TextStacking { get; set; } = DEFAULT_TEXT_STACKING; 20 | 21 | private int? _weight; 22 | [NotificationXmlAttribute("hint-weight")] 23 | public int? Weight 24 | { 25 | get { return _weight; } 26 | 27 | set 28 | { 29 | CheckWeight(value); 30 | 31 | _weight = value; 32 | } 33 | } 34 | 35 | internal static void CheckWeight(int? weight) 36 | { 37 | if (weight != null && weight.Value < 1) 38 | throw new ArgumentOutOfRangeException("Weight must be between 1 and int.MaxValue, inclusive (or null)"); 39 | } 40 | 41 | public IList Children { get; private set; } = new List(); 42 | 43 | public IEnumerable Descendants() 44 | { 45 | foreach (IElement_AdaptiveSubgroupChild child in Children) 46 | { 47 | // Return each child (we know there's no further descendants) 48 | yield return child; 49 | } 50 | } 51 | } 52 | 53 | internal interface IElement_AdaptiveSubgroupChild { } 54 | } 55 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/Elements/Element_AdaptiveText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Tiles; 9 | using NotificationsExtensions.Toasts; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions.Adaptive.Elements 15 | { 16 | [NotificationXmlElement("text")] 17 | internal sealed class Element_AdaptiveText : IElement_TileBindingChild, IElement_TileSubgroupChild, IElement_AdaptiveSubgroupChild, IElement_ToastBindingChild 18 | { 19 | internal const AdaptiveTextStyle DEFAULT_STYLE = AdaptiveTextStyle.Default; 20 | internal const AdaptiveTextAlign DEFAULT_ALIGN = AdaptiveTextAlign.Default; 21 | internal const AdaptiveTextPlacement DEFAULT_PLACEMENT = AdaptiveTextPlacement.Inline; 22 | 23 | [NotificationXmlContent] 24 | public string Text { get; set; } 25 | 26 | [NotificationXmlAttribute("id")] 27 | public int? Id { get; set; } 28 | 29 | [NotificationXmlAttribute("lang")] 30 | public string Lang { get; set; } 31 | 32 | [NotificationXmlAttribute("hint-align", DEFAULT_ALIGN)] 33 | public AdaptiveTextAlign Align { get; set; } = DEFAULT_ALIGN; 34 | 35 | private int? _maxLines; 36 | [NotificationXmlAttribute("hint-maxLines")] 37 | public int? MaxLines 38 | { 39 | get { return _maxLines; } 40 | set 41 | { 42 | if (value != null) 43 | CheckMaxLinesValue(value.Value); 44 | 45 | _maxLines = value; 46 | } 47 | } 48 | 49 | internal static void CheckMaxLinesValue(int value) 50 | { 51 | if (value < 1) 52 | throw new ArgumentOutOfRangeException("MaxLines must be between 1 and int.MaxValue, inclusive."); 53 | } 54 | 55 | private int? _minLines; 56 | [NotificationXmlAttribute("hint-minLines")] 57 | public int? MinLines 58 | { 59 | get { return _minLines; } 60 | set 61 | { 62 | if (value != null) 63 | CheckMinLinesValue(value.Value); 64 | 65 | _minLines = value; 66 | } 67 | } 68 | 69 | internal static void CheckMinLinesValue(int value) 70 | { 71 | if (value < 1) 72 | throw new ArgumentOutOfRangeException("MinLines must be between 1 and int.MaxValue, inclusive."); 73 | } 74 | 75 | [NotificationXmlAttribute("hint-style", DEFAULT_STYLE)] 76 | public AdaptiveTextStyle Style { get; set; } = DEFAULT_STYLE; 77 | 78 | [NotificationXmlAttribute("hint-wrap")] 79 | public bool? Wrap { get; set; } 80 | 81 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 82 | public AdaptiveTextPlacement Placement { get; set; } = DEFAULT_PLACEMENT; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/IAdaptiveCollection.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions 13 | { 14 | public interface IAdaptiveCollection : IList 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/IBaseImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions 13 | { 14 | /// 15 | /// Contains the base properties that an image needs. 16 | /// 17 | public interface IBaseImage 18 | { 19 | /// 20 | /// The URI of the image. Can be from your application package, application data, or the internet. Internet images must be less than 200 KB in size. 21 | /// 22 | string Source { get; set; } 23 | 24 | /// 25 | /// A description of the image, for users of assistive technologies. 26 | /// 27 | string AlternateText { get; set; } 28 | 29 | /// 30 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 31 | /// 32 | bool? AddImageQuery { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Adaptive/IBaseText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions 13 | { 14 | /// 15 | /// Defines the basic properties of a text element. 16 | /// 17 | public interface IBaseText 18 | { 19 | /// 20 | /// The text to display. 21 | /// 22 | string Text { get; set; } 23 | 24 | /// 25 | /// The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. 26 | /// 27 | string Language { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Common/ContentInterfaces.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #if WINDOWS_UWP 9 | using Windows.Data.Xml.Dom; 10 | #endif 11 | 12 | namespace NotificationsExtensions 13 | { 14 | /// 15 | /// Base notification content interface to retrieve notification Xml as a string. 16 | /// 17 | public interface INotificationContent 18 | { 19 | /// 20 | /// Retrieves the notification Xml content as a string. 21 | /// 22 | /// The notification Xml content as a string. 23 | string GetContent(); 24 | 25 | #if WINDOWS_UWP 26 | /// 27 | /// Retrieves the notification Xml content as a WinRT Xml document. 28 | /// 29 | /// The notification Xml content as a WinRT Xml document. 30 | XmlDocument GetXml(); 31 | #endif 32 | } 33 | 34 | namespace Badges 35 | { 36 | 37 | /// 38 | /// The types of glyphs that can be placed on a badge. 39 | /// 40 | public enum GlyphValue 41 | { 42 | /// 43 | /// No glyph. If there is a numeric badge, or a glyph currently on the badge, 44 | /// it will be removed. 45 | /// 46 | None = 0, 47 | /// 48 | /// A glyph representing application activity. 49 | /// 50 | Activity, 51 | /// 52 | /// A glyph representing an alert. 53 | /// 54 | Alert, 55 | /// 56 | /// A glyph representing an alarm. 57 | /// 58 | Alarm, 59 | /// 60 | /// A glyph representing availability status. 61 | /// 62 | Available, 63 | /// 64 | /// A glyph representing away status 65 | /// 66 | Away, 67 | /// 68 | /// A glyph representing busy status. 69 | /// 70 | Busy, 71 | /// 72 | /// A glyph representing that a new message is available. 73 | /// 74 | NewMessage, 75 | /// 76 | /// A glyph representing that media is paused. 77 | /// 78 | Paused, 79 | /// 80 | /// A glyph representing that media is playing. 81 | /// 82 | Playing, 83 | /// 84 | /// A glyph representing unavailable status. 85 | /// 86 | Unavailable, 87 | /// 88 | /// A glyph representing an error. 89 | /// 90 | Error, 91 | /// 92 | /// A glyph representing attention status. 93 | /// 94 | Attention 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/NotificationsExtensions.shproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 8f4cc187-1ae8-4db4-9cbc-0380de29e84b 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Adaptive/Common.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | /// 13 | /// TextStacking specifies the vertical alignment of content. 14 | /// 15 | public enum TileTextStacking 16 | { 17 | /// 18 | /// Vertical align to the top. 19 | /// 20 | [EnumString("top")] 21 | Top, 22 | 23 | /// 24 | /// Vertical align to the center. 25 | /// 26 | [EnumString("center")] 27 | Center, 28 | 29 | /// 30 | /// Vertical align to the bottom. 31 | /// 32 | [EnumString("bottom")] 33 | Bottom 34 | } 35 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Adaptive/TileGroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// Groups semantically identify that the content in the group must either be displayed as a whole, or not displayed if it cannot fit. Groups also allow creating multiple columns. 15 | /// 16 | [Obsolete("Use AdaptiveGroup instead.")] 17 | public sealed class TileGroup : ITileAdaptiveChild 18 | { 19 | /// 20 | /// Initializes a new tile group. Groups semantically identify that the content in the group must either be displayed as a whole, or not displayed if it cannot fit. Groups also allow creating multiple columns. 21 | /// 22 | public TileGroup() { } 23 | 24 | /// 25 | /// The only valid children of groups are . Each subgroup is displayed as a separate vertical column. 26 | /// 27 | public IList Children { get; private set; } = new List(); 28 | 29 | internal Element_TileGroup ConvertToElement() 30 | { 31 | Element_TileGroup group = new Element_TileGroup(); 32 | 33 | foreach (var subgroup in Children) 34 | group.Children.Add(subgroup.ConvertToElement()); 35 | 36 | return group; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Adaptive/TileSubgroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// Subgroups are vertical columns that can contain text and images. 15 | /// 16 | [Obsolete("Use AdaptiveSubgroup instead.")] 17 | public sealed class TileSubgroup 18 | { 19 | /// 20 | /// Initializes a new subgroup. Subgroups are vertical columns that can contain text and images. 21 | /// 22 | public TileSubgroup() { } 23 | 24 | /// 25 | /// and are valid children of subgroups. 26 | /// 27 | public IList Children { get; private set; } = new List(); 28 | 29 | private int? _weight; 30 | 31 | /// 32 | /// Control the width of this subgroup column by specifying the weight, relative to the other subgroups. 33 | /// 34 | public int? Weight 35 | { 36 | get { return _weight; } 37 | set 38 | { 39 | Element_TileSubgroup.CheckWeight(value); 40 | 41 | _weight = value; 42 | } 43 | } 44 | 45 | /// 46 | /// Control the vertical alignment of this subgroup's content. 47 | /// 48 | public TileTextStacking TextStacking { get; set; } = Element_TileSubgroup.DEFAULT_TEXT_STACKING; 49 | 50 | internal Element_TileSubgroup ConvertToElement() 51 | { 52 | var subgroup = new Element_TileSubgroup() 53 | { 54 | Weight = Weight, 55 | TextStacking = TextStacking 56 | }; 57 | 58 | foreach (var child in Children) 59 | { 60 | subgroup.Children.Add(ConvertToSubgroupChildElement(child)); 61 | } 62 | 63 | return subgroup; 64 | } 65 | 66 | private static IElement_TileSubgroupChild ConvertToSubgroupChildElement(ITileSubgroupChild child) 67 | { 68 | if (child is TileText) 69 | return (child as TileText).ConvertToElement(); 70 | 71 | else if (child is TileImage) 72 | return (child as TileImage).ConvertToElement(); 73 | 74 | else 75 | throw new NotImplementedException("Unknown child: " + child.GetType()); 76 | } 77 | } 78 | 79 | 80 | /// 81 | /// Elements (, ) that can be direct children of a . 82 | /// 83 | public interface ITileSubgroupChild 84 | { 85 | } 86 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Adaptive/TileTextAlign.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | /// 13 | /// Controls the horizontal alignment of text. 14 | /// 15 | public enum TileTextAlign 16 | { 17 | /// 18 | /// Default value. The system automatically decides the alignment based on the language and culture. 19 | /// 20 | Auto, 21 | 22 | /// 23 | /// Horizontally align the text to the left. 24 | /// 25 | [EnumString("left")] 26 | Left, 27 | 28 | /// 29 | /// Horizontally align the text in the center. 30 | /// 31 | [EnumString("center")] 32 | Center, 33 | 34 | /// 35 | /// Horizontally align the text to the right. 36 | /// 37 | [EnumString("right")] 38 | Right 39 | } 40 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Common.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | internal static class TileSizeToAdaptiveTemplateConverter 14 | { 15 | public static TileTemplateNameV3 Convert(TileSize size) 16 | { 17 | switch (size) 18 | { 19 | case TileSize.Small: 20 | return TileTemplateNameV3.TileSmall; 21 | 22 | case TileSize.Medium: 23 | return TileTemplateNameV3.TileMedium; 24 | 25 | case TileSize.Wide: 26 | return TileTemplateNameV3.TileWide; 27 | 28 | case TileSize.Large: 29 | return TileTemplateNameV3.TileLarge; 30 | 31 | default: 32 | throw new NotImplementedException(); 33 | } 34 | } 35 | } 36 | 37 | internal enum TileSize 38 | { 39 | Small, 40 | Medium, 41 | Wide, 42 | Large 43 | } 44 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Common.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | internal enum TilePresentation 13 | { 14 | [EnumString("people")] 15 | People, 16 | 17 | [EnumString("photos")] 18 | Photos, 19 | 20 | [EnumString("contact")] 21 | Contact 22 | } 23 | 24 | internal enum TileImagePlacement 25 | { 26 | [EnumString("inline")] 27 | Inline, 28 | 29 | [EnumString("background")] 30 | Background, 31 | 32 | [EnumString("peek")] 33 | Peek 34 | } 35 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_Tile.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | [NotificationXmlElement("tile")] 13 | internal sealed class Element_Tile : BaseElement 14 | { 15 | public Element_TileVisual Visual { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_TileGroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | [NotificationXmlElement("group")] 14 | internal sealed class Element_TileGroup : IElement_TileBindingChild, IElementWithDescendants 15 | { 16 | public IList Children { get; private set; } = new List(); 17 | 18 | public IEnumerable Descendants() 19 | { 20 | foreach (Element_TileSubgroup subgroup in Children) 21 | { 22 | // Return the subgroup 23 | yield return subgroup; 24 | 25 | // And also return its descendants 26 | foreach (object descendant in subgroup.Descendants()) 27 | yield return descendant; 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_TileImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | [NotificationXmlElement("image")] 13 | internal sealed class Element_TileImage : IElement_TileBindingChild, IElement_TileSubgroupChild 14 | { 15 | internal const TileImagePlacement DEFAULT_PLACEMENT = TileImagePlacement.Inline; 16 | internal const TileImageCrop DEFAULT_CROP = TileImageCrop.None; 17 | internal const bool DEFAULT_REMOVE_MARGIN = false; 18 | internal const TileImageAlign DEFAULT_ALIGN = TileImageAlign.Stretch; 19 | 20 | [NotificationXmlAttribute("id")] 21 | public int? Id { get; set; } 22 | 23 | [NotificationXmlAttribute("src")] 24 | public string Src { get; set; } 25 | 26 | [NotificationXmlAttribute("alt")] 27 | public string Alt { get; set; } 28 | 29 | [NotificationXmlAttribute("addImageQuery")] 30 | public bool? AddImageQuery { get; set; } 31 | 32 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 33 | public TileImagePlacement Placement { get; set; } = DEFAULT_PLACEMENT; 34 | 35 | [NotificationXmlAttribute("hint-align", DEFAULT_ALIGN)] 36 | public TileImageAlign Align { get; set; } = DEFAULT_ALIGN; 37 | 38 | [NotificationXmlAttribute("hint-crop", DEFAULT_CROP)] 39 | public TileImageCrop Crop { get; set; } = DEFAULT_CROP; 40 | 41 | [NotificationXmlAttribute("hint-removeMargin", DEFAULT_REMOVE_MARGIN)] 42 | public bool RemoveMargin { get; set; } = DEFAULT_REMOVE_MARGIN; 43 | 44 | private int? _overlay; 45 | [NotificationXmlAttribute("hint-overlay")] 46 | public int? Overlay 47 | { 48 | get { return _overlay; } 49 | set 50 | { 51 | if (value != null) 52 | Element_TileBinding.CheckOverlayValue(value.Value); 53 | 54 | _overlay = value; 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_TileSubgroup.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace NotificationsExtensions.Tiles 13 | { 14 | [NotificationXmlElement("subgroup")] 15 | internal sealed class Element_TileSubgroup : IElementWithDescendants 16 | { 17 | internal const TileTextStacking DEFAULT_TEXT_STACKING = TileTextStacking.Top; 18 | 19 | [NotificationXmlAttribute("hint-textStacking", DEFAULT_TEXT_STACKING)] 20 | public TileTextStacking TextStacking { get; set; } = DEFAULT_TEXT_STACKING; 21 | 22 | private int? _weight; 23 | [NotificationXmlAttribute("hint-weight")] 24 | public int? Weight 25 | { 26 | get { return _weight; } 27 | 28 | set 29 | { 30 | CheckWeight(value); 31 | 32 | _weight = value; 33 | } 34 | } 35 | 36 | internal static void CheckWeight(int? weight) 37 | { 38 | if (weight != null && weight.Value < 1) 39 | throw new ArgumentOutOfRangeException("Weight must be between 1 and int.MaxValue, inclusive (or null)"); 40 | } 41 | 42 | public IList Children { get; private set; } = new List(); 43 | 44 | public IEnumerable Descendants() 45 | { 46 | foreach (IElement_TileSubgroupChild child in Children) 47 | { 48 | // Return each child (we know there's no further descendants) 49 | yield return child; 50 | } 51 | } 52 | } 53 | 54 | internal interface IElement_TileSubgroupChild { } 55 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_TileText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | [NotificationXmlElement("text")] 14 | internal sealed class Element_TileText : IElement_TileBindingChild, IElement_TileSubgroupChild 15 | { 16 | internal const TileTextStyle DEFAULT_STYLE = TileTextStyle.Caption; 17 | internal const bool DEFAULT_WRAP = false; 18 | internal const int DEFAULT_MAX_LINES = int.MaxValue; 19 | internal const int DEFAULT_MIN_LINES = 1; 20 | internal const TileTextAlign DEFAULT_ALIGN = TileTextAlign.Auto; 21 | 22 | [NotificationXmlContent] 23 | public string Text { get; set; } 24 | 25 | [NotificationXmlAttribute("id")] 26 | public int? Id { get; set; } 27 | 28 | [NotificationXmlAttribute("lang")] 29 | public string Lang { get; set; } 30 | 31 | [NotificationXmlAttribute("hint-align", DEFAULT_ALIGN)] 32 | public TileTextAlign Align { get; set; } = DEFAULT_ALIGN; 33 | 34 | private int _maxLines = DEFAULT_MAX_LINES; 35 | [NotificationXmlAttribute("hint-maxLines", DEFAULT_MAX_LINES)] 36 | public int MaxLines 37 | { 38 | get { return _maxLines; } 39 | set 40 | { 41 | CheckMaxLinesValue(value); 42 | 43 | _maxLines = value; 44 | } 45 | } 46 | 47 | internal static void CheckMaxLinesValue(int value) 48 | { 49 | if (value < 1) 50 | throw new ArgumentOutOfRangeException("MaxLines must be between 1 and int.MaxValue, inclusive."); 51 | } 52 | 53 | private int _minLines = DEFAULT_MIN_LINES; 54 | [NotificationXmlAttribute("hint-minLines", DEFAULT_MIN_LINES)] 55 | public int MinLines 56 | { 57 | get { return _minLines; } 58 | set 59 | { 60 | CheckMinLinesValue(value); 61 | 62 | _minLines = value; 63 | } 64 | } 65 | 66 | internal static void CheckMinLinesValue(int value) 67 | { 68 | if (value < 1) 69 | throw new ArgumentOutOfRangeException("MinLines must be between 1 and int.MaxValue, inclusive."); 70 | } 71 | 72 | [NotificationXmlAttribute("hint-style", DEFAULT_STYLE)] 73 | public TileTextStyle Style { get; set; } = DEFAULT_STYLE; 74 | 75 | [NotificationXmlAttribute("hint-wrap", DEFAULT_WRAP)] 76 | public bool Wrap { get; set; } = DEFAULT_WRAP; 77 | } 78 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/Elements/Element_TileVisual.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace NotificationsExtensions.Tiles 13 | { 14 | [NotificationXmlElement("visual")] 15 | internal sealed class Element_TileVisual 16 | { 17 | internal const TileBranding DEFAULT_BRANDING = TileBranding.Auto; 18 | internal const bool DEFAULT_ADD_IMAGE_QUERY = false; 19 | 20 | [NotificationXmlAttribute("addImageQuery")] 21 | public bool? AddImageQuery { get; set; } 22 | 23 | [NotificationXmlAttribute("baseUri")] 24 | public Uri BaseUri { get; set; } 25 | 26 | [NotificationXmlAttribute("branding", DEFAULT_BRANDING)] 27 | public TileBranding Branding { get; set; } = DEFAULT_BRANDING; 28 | 29 | [NotificationXmlAttribute("contentId")] 30 | public string ContentId { get; set; } 31 | 32 | [NotificationXmlAttribute("displayName")] 33 | public string DisplayName { get; set; } 34 | 35 | [NotificationXmlAttribute("lang")] 36 | public string Language { get; set; } 37 | 38 | [NotificationXmlAttribute("version")] 39 | public int? Version { get; set; } 40 | 41 | [NotificationXmlAttribute("arguments")] 42 | public string Arguments { get; set; } 43 | 44 | public IList Bindings { get; private set; } = new List(); 45 | } 46 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/SpecialTemplates/TileBindingContentContact.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Tiles 11 | { 12 | /// 13 | /// Phone-only. Supported on Small, Medium, and Wide. 14 | /// 15 | public sealed class TileBindingContentContact : ITileBindingContent 16 | { 17 | /// 18 | /// Phone-only. Supported on Small, Medium, and Wide. 19 | /// 20 | public TileBindingContentContact() { } 21 | 22 | /// 23 | /// The image to display. 24 | /// 25 | public TileImageSource Image { get; set; } 26 | 27 | /// 28 | /// NOT DISPLAYED ON SMALL TILE SIZE. A line of text that is displayed. 29 | /// 30 | public TileBasicText Text { get; set; } 31 | 32 | internal TileTemplateNameV3 GetTemplateName(TileSize size) 33 | { 34 | return TileSizeToAdaptiveTemplateConverter.Convert(size); 35 | } 36 | 37 | internal void PopulateElement(Element_TileBinding binding, TileSize size) 38 | { 39 | binding.Presentation = TilePresentation.Contact; 40 | 41 | // Small size doesn't display the text, so no reason to include it in the payload 42 | if (Text != null && size != TileSize.Small) 43 | binding.Children.Add(Text.ConvertToElement()); 44 | 45 | if (Image != null) 46 | binding.Children.Add(Image.ConvertToElement()); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/SpecialTemplates/TileBindingContentIconic.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// Supported on Small and Medium. Enables an iconic tile template, where you can have an icon and badge display next to each other on the tile, in true classic Windows Phone style. The number next to the icon is achieved through a separate badge notification. 15 | /// 16 | public sealed class TileBindingContentIconic : ITileBindingContent 17 | { 18 | /// 19 | /// Supported on Small and Medium. Enables an iconic tile template, where you can have an icon and badge display next to each other on the tile, in true classic Windows Phone style. The number next to the icon is achieved through a separate badge notification. 20 | /// 21 | public TileBindingContentIconic() { } 22 | 23 | /// 24 | /// At minimum, to support both Desktop and Phone, Small and Medium tiles, provide a square aspect ratio image with a resolution of 200x200, PNG format, with transparency and no color other than white. For more info see: http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/07/31/iconic-tile-template-for-windows-10.aspx 25 | /// 26 | public TileImageSource Icon { get; set; } 27 | 28 | internal TileTemplateNameV3 GetTemplateName(TileSize size) 29 | { 30 | switch (size) 31 | { 32 | case TileSize.Small: 33 | return TileTemplateNameV3.TileSquare71x71IconWithBadge; 34 | 35 | case TileSize.Medium: 36 | return TileTemplateNameV3.TileSquare150x150IconWithBadge; 37 | 38 | default: 39 | throw new ArgumentException("The Iconic template is only supported on Small and Medium tiles."); 40 | } 41 | } 42 | 43 | internal void PopulateElement(Element_TileBinding binding, TileSize size) 44 | { 45 | if (Icon != null) 46 | { 47 | var element = Icon.ConvertToElement(); 48 | element.Id = 1; 49 | binding.Children.Add(element); 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/SpecialTemplates/TileBindingContentPeople.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// New in 1511: Supported on Medium, Wide, and Large (Desktop and Mobile). 15 | /// Previously for RTM: Phone-only. Supported on Medium and Wide. 16 | /// 17 | public sealed class TileBindingContentPeople : ITileBindingContent 18 | { 19 | /// 20 | /// New in 1511: Supported on Medium, Wide, and Large (Desktop and Mobile). 21 | /// Previously for RTM: Phone-only. Supported on Medium and Wide. 22 | /// 23 | public TileBindingContentPeople() { } 24 | 25 | /// 26 | /// Images that will roll around as circles. 27 | /// 28 | public IList Images { get; private set; } = new List(); 29 | 30 | internal TileTemplateNameV3 GetTemplateName(TileSize size) 31 | { 32 | return TileSizeToAdaptiveTemplateConverter.Convert(size); 33 | } 34 | 35 | internal void PopulateElement(Element_TileBinding binding, TileSize size) 36 | { 37 | binding.Presentation = TilePresentation.People; 38 | 39 | foreach (var img in Images) 40 | binding.Children.Add(img.ConvertToElement()); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/SpecialTemplates/TileBindingContentPhotos.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// Animates through a slideshow of photos. Supported on all sizes. 15 | /// 16 | public sealed class TileBindingContentPhotos : ITileBindingContent 17 | { 18 | /// 19 | /// Animates through a slideshow of photos. Supported on all sizes. 20 | /// 21 | public TileBindingContentPhotos() { } 22 | 23 | /// 24 | /// Up to 12 images can be provided (Mobile will only display up to 9), which will be used for the slideshow. Adding more than 12 will throw an exception. 25 | /// 26 | public IList Images { get; private set; } = new LimitedList(12); 27 | 28 | internal TileTemplateNameV3 GetTemplateName(TileSize size) 29 | { 30 | return TileSizeToAdaptiveTemplateConverter.Convert(size); 31 | } 32 | 33 | internal void PopulateElement(Element_TileBinding binding, TileSize size) 34 | { 35 | binding.Presentation = TilePresentation.Photos; 36 | 37 | foreach (var img in Images) 38 | binding.Children.Add(img.ConvertToElement()); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileBasicText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Tiles 10 | { 11 | /// 12 | /// A text element on the tile. 13 | /// 14 | public sealed class TileBasicText 15 | { 16 | /// 17 | /// The text value that will be shown in the text field. 18 | /// 19 | public string Text { get; set; } 20 | 21 | /// 22 | /// The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. 23 | /// 24 | public string Lang { get; set; } 25 | 26 | internal Element_TileText ConvertToElement() 27 | { 28 | return new Element_TileText() 29 | { 30 | Text = Text, 31 | Lang = Lang 32 | }; 33 | } 34 | 35 | /// 36 | /// Returns the Text property value. 37 | /// 38 | /// 39 | public override string ToString() 40 | { 41 | return Text; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileBranding.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Tiles 10 | { 11 | /// 12 | /// The form that the tile should use to display the app's brand. 13 | /// 14 | public enum TileBranding 15 | { 16 | /// 17 | /// The default choice. If ShowNameOn___ is true for the tile size being displayed, then branding will be "Name". Otherwise it will be "None". 18 | /// 19 | Auto, 20 | 21 | /// 22 | /// No branding will be displayed. 23 | /// 24 | [EnumString("none")] 25 | None, 26 | 27 | /// 28 | /// The DisplayName will be shown. 29 | /// 30 | [EnumString("name")] 31 | Name, 32 | 33 | /// 34 | /// Desktop-only. The Square44x44Logo will be shown. On Mobile, this will fallback to Name. 35 | /// 36 | [EnumString("logo")] 37 | Logo, 38 | 39 | /// 40 | /// Desktop-only. Both the DisplayName and Square44x44Logo will be shown. On Mobile, this will fallback to Name. 41 | /// 42 | [EnumString("nameAndLogo")] 43 | NameAndLogo 44 | } 45 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileContent.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #if WINDOWS_UWP 9 | using Windows.Data.Xml.Dom; 10 | #endif 11 | 12 | namespace NotificationsExtensions.Tiles 13 | { 14 | 15 | /// 16 | /// Base tile element, which contains a single visual element. 17 | /// 18 | public sealed class TileContent 19 | { 20 | /// 21 | /// Initializes a new instance of a tile notification's content. You must then set the Visual property, which is required for a tile notification. 22 | /// 23 | public TileContent() { } 24 | 25 | /// 26 | /// The visual element is required. 27 | /// 28 | public TileVisual Visual { get; set; } 29 | 30 | 31 | /// 32 | /// Retrieves the notification XML content as a string, so that it can be sent with a HTTP POST in a push notification. 33 | /// 34 | /// The notification XML content as a string. 35 | public string GetContent() 36 | { 37 | return ConvertToElement().GetContent(); 38 | } 39 | 40 | #if WINDOWS_UWP 41 | /// 42 | /// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local tile notification's constructor on either or . 43 | /// 44 | /// The notification XML content as a WinRT XmlDocument. 45 | public XmlDocument GetXml() 46 | { 47 | XmlDocument doc = new XmlDocument(); 48 | doc.LoadXml(GetContent()); 49 | 50 | return doc; 51 | } 52 | 53 | #endif 54 | 55 | internal Element_Tile ConvertToElement() 56 | { 57 | var tile = new Element_Tile(); 58 | 59 | if (Visual != null) 60 | tile.Visual = Visual.ConvertToElement(); 61 | 62 | return tile; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileImageSource.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Tiles 12 | { 13 | /// 14 | /// Defines a tile image source and related properties. 15 | /// 16 | public sealed class TileImageSource 17 | { 18 | /// 19 | /// Constructs an image source with all the required properties. 20 | /// 21 | /// The URI of the image source. Can be from your application package, application data, or the internet. 22 | public TileImageSource(string src) 23 | { 24 | if (src == null) 25 | throw new ArgumentNullException("src"); 26 | 27 | Src = src; 28 | } 29 | 30 | /// 31 | /// The URI of the image source. Can be from your application package, application data, or the internet. 32 | /// 33 | public string Src { get; private set; } 34 | 35 | /// 36 | /// A description of the image, for users of assistive technologies. 37 | /// 38 | public string Alt { get; set; } 39 | 40 | /// 41 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 42 | /// 43 | public bool? AddImageQuery { get; set; } 44 | 45 | internal Element_TileImage ConvertToElement() 46 | { 47 | Element_TileImage image = new Element_TileImage(); 48 | 49 | PopulateElement(image); 50 | 51 | return image; 52 | } 53 | 54 | internal void PopulateElement(Element_TileImage image) 55 | { 56 | image.Src = Src; 57 | image.Alt = Alt; 58 | image.AddImageQuery = AddImageQuery; 59 | } 60 | 61 | /// 62 | /// Returns the value of the Src property. 63 | /// 64 | /// 65 | public override string ToString() 66 | { 67 | return Src; 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileTemplateNameV1.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Tiles 10 | { 11 | internal enum TileTemplateNameV1 12 | { 13 | TileSquareBlock, 14 | TileSquareImage, 15 | TileSquarePeekImageAndText01, 16 | TileSquarePeekImageAndText02, 17 | TileSquarePeekImageAndText03, 18 | TileSquarePeekImageAndText04, 19 | TileSquareText01, 20 | TileSquareText02, 21 | TileSquareText03, 22 | TileSquareText04, 23 | TileWideBlockAndText01, 24 | TileWideBlockAndText02, 25 | TileWideImage, 26 | TileWideImageAndText01, 27 | TileWideImageAndText02, 28 | TileWideImageCollection, 29 | TileWidePeekImage01, 30 | TileWidePeekImage02, 31 | TileWidePeekImage03, 32 | TileWidePeekImage04, 33 | TileWidePeekImage05, 34 | TileWidePeekImage06, 35 | TileWidePeekImageAndText01, 36 | TileWidePeekImageAndText02, 37 | TileWidePeekImageCollection01, 38 | TileWidePeekImageCollection02, 39 | TileWidePeekImageCollection03, 40 | TileWidePeekImageCollection04, 41 | TileWidePeekImageCollection05, 42 | TileWidePeekImageCollection06, 43 | TileWideSmallImageAndText01, 44 | TileWideSmallImageAndText02, 45 | TileWideSmallImageAndText03, 46 | TileWideSmallImageAndText04, 47 | TileWideSmallImageAndText05, 48 | TileWideText01, 49 | TileWideText02, 50 | TileWideText03, 51 | TileWideText04, 52 | TileWideText05, 53 | TileWideText06, 54 | TileWideText07, 55 | TileWideText08, 56 | TileWideText09, 57 | TileWideText10, 58 | TileWideText11 59 | } 60 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Tiles/TileTemplateNameV3.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Tiles 10 | { 11 | internal enum TileTemplateNameV3 12 | { 13 | TileMedium, 14 | TileSmall, 15 | TileWide, 16 | TileLarge, 17 | 18 | TileSquare150x150Block 19 | , TileSquare150x150Image 20 | , TileSquare150x150PeekImageAndText01 21 | , TileSquare150x150PeekImageAndText02 22 | , TileSquare150x150PeekImageAndText03 23 | , TileSquare150x150PeekImageAndText04 24 | , TileSquare150x150Text01 25 | , TileSquare150x150Text02 26 | , TileSquare150x150Text03 27 | , TileSquare150x150Text04 28 | , TileSquare310x310BlockAndText01 29 | , TileSquare310x310BlockAndText02 30 | , TileSquare310x310Image 31 | , TileSquare310x310ImageAndText01 32 | , TileSquare310x310ImageAndText02 33 | , TileSquare310x310ImageAndTextOverlay01 34 | , TileSquare310x310ImageAndTextOverlay02 35 | , TileSquare310x310ImageAndTextOverlay03 36 | , TileSquare310x310ImageCollection 37 | , TileSquare310x310ImageCollectionAndText01 38 | , TileSquare310x310ImageCollectionAndText02 39 | , TileSquare310x310SmallImagesAndTextList01 40 | , TileSquare310x310SmallImagesAndTextList02 41 | , TileSquare310x310SmallImagesAndTextList03 42 | , TileSquare310x310SmallImagesAndTextList04 43 | , TileSquare310x310Text01 44 | , TileSquare310x310Text02 45 | , TileSquare310x310Text03 46 | , TileSquare310x310Text04 47 | , TileSquare310x310Text05 48 | , TileSquare310x310Text06 49 | , TileSquare310x310Text07 50 | , TileSquare310x310Text08 51 | , TileSquare310x310TextList01 52 | , TileSquare310x310TextList02 53 | , TileSquare310x310TextList03 54 | , TileWide310x150BlockAndText01 55 | , TileWide310x150BlockAndText02 56 | , TileWide310x150Image 57 | , TileWide310x150ImageAndText01 58 | , TileWide310x150ImageAndText02 59 | , TileWide310x150ImageCollection 60 | , TileWide310x150PeekImage01 61 | , TileWide310x150PeekImage02 62 | , TileWide310x150PeekImage03 63 | , TileWide310x150PeekImage04 64 | , TileWide310x150PeekImage05 65 | , TileWide310x150PeekImage06 66 | , TileWide310x150PeekImageAndText01 67 | , TileWide310x150PeekImageAndText02 68 | , TileWide310x150PeekImageCollection01 69 | , TileWide310x150PeekImageCollection02 70 | , TileWide310x150PeekImageCollection03 71 | , TileWide310x150PeekImageCollection04 72 | , TileWide310x150PeekImageCollection05 73 | , TileWide310x150PeekImageCollection06 74 | , TileWide310x150SmallImageAndText01 75 | , TileWide310x150SmallImageAndText02 76 | , TileWide310x150SmallImageAndText03 77 | , TileWide310x150SmallImageAndText04 78 | , TileWide310x150SmallImageAndText05 79 | , TileWide310x150Text01 80 | , TileWide310x150Text02 81 | , TileWide310x150Text03 82 | , TileWide310x150Text04 83 | , TileWide310x150Text05 84 | , TileWide310x150Text06 85 | , TileWide310x150Text07 86 | , TileWide310x150Text08 87 | , TileWide310x150Text09 88 | , TileWide310x150Text10 89 | , TileWide310x150Text11, 90 | 91 | 92 | 93 | TileSquare71x71Image, 94 | TileSquare71x71IconWithBadge, 95 | TileSquare150x150IconWithBadge, 96 | TileWide310x150IconWithBadgeAndText 97 | 98 | 99 | } 100 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Common.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | /// 13 | /// Decides the type of activation that will be used when the user interacts with the toast notification. 14 | /// 15 | public enum ToastActivationType 16 | { 17 | /// 18 | /// Default value. Your foreground app is launched. 19 | /// 20 | Foreground, 21 | 22 | /// 23 | /// Your corresponding background task (assuming you set everything up) is triggered, and you can execute code in the background (like sending the user's quick reply message) without interrupting the user. 24 | /// 25 | [EnumString("background")] 26 | Background, 27 | 28 | /// 29 | /// Launch a different app using protocol activation. 30 | /// 31 | [EnumString("protocol")] 32 | Protocol 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_Toast.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | [NotificationXmlElement("toast")] 13 | internal sealed class Element_Toast : BaseElement 14 | { 15 | internal const ToastScenario DEFAULT_SCENARIO = ToastScenario.Default; 16 | internal const ToastActivationType DEFAULT_ACTIVATION_TYPE = ToastActivationType.Foreground; 17 | internal const ToastDuration DEFAULT_DURATION = ToastDuration.Short; 18 | 19 | [NotificationXmlAttribute("activationType", DEFAULT_ACTIVATION_TYPE)] 20 | public ToastActivationType ActivationType { get; set; } = DEFAULT_ACTIVATION_TYPE; 21 | 22 | [NotificationXmlAttribute("duration", DEFAULT_DURATION)] 23 | public ToastDuration Duration { get; set; } = DEFAULT_DURATION; 24 | 25 | [NotificationXmlAttribute("launch")] 26 | public string Launch { get; set; } 27 | 28 | [NotificationXmlAttribute("scenario", DEFAULT_SCENARIO)] 29 | public ToastScenario Scenario { get; set; } = DEFAULT_SCENARIO; 30 | 31 | public Element_ToastVisual Visual { get; set; } 32 | 33 | public Element_ToastAudio Audio { get; set; } 34 | 35 | public Element_ToastActions Actions { get; set; } 36 | } 37 | 38 | /// 39 | /// The amount of time the toast should display. 40 | /// 41 | public enum ToastDuration 42 | { 43 | /// 44 | /// Default value. Toast appears for a short while and then goes into Action Center. 45 | /// 46 | Short, 47 | 48 | /// 49 | /// Toast stays on-screen for longer, and then goes into Action Center. 50 | /// 51 | [EnumString("long")] 52 | Long 53 | } 54 | 55 | /// 56 | /// Specifies the scenario, controlling behaviors about the toast. 57 | /// 58 | public enum ToastScenario 59 | { 60 | /// 61 | /// The normal toast behavior. The toast appears for a short duration, and then automatically dismisses into Action Center. 62 | /// 63 | Default, 64 | 65 | /// 66 | /// Causes the toast to stay on-screen and expanded until the user takes action. Also causes a looping alarm sound to be selected by default. 67 | /// 68 | [EnumString("alarm")] 69 | Alarm, 70 | 71 | /// 72 | /// Causes the toast to stay on-screen and expanded until the user takes action. 73 | /// 74 | [EnumString("reminder")] 75 | Reminder, 76 | 77 | /// 78 | /// Causes the toast to stay on-screen and expanded until the user takes action (on Mobile this expands to full screen). Also causes a looping incoming call sound to be selected by default. 79 | /// 80 | [EnumString("incomingCall")] 81 | IncomingCall 82 | } 83 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastAction.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | [NotificationXmlElement("action")] 13 | internal sealed class Element_ToastAction : IElement_ToastActionsChild 14 | { 15 | internal const Element_ToastActivationType DEFAULT_ACTIVATION_TYPE = Element_ToastActivationType.Foreground; 16 | internal const Element_ToastActionPlacement DEFAULT_PLACEMENT = Element_ToastActionPlacement.Inline; 17 | 18 | /// 19 | /// The text to be displayed on the button. 20 | /// 21 | [NotificationXmlAttribute("content")] 22 | public string Content { get; set; } 23 | 24 | /// 25 | /// The arguments attribute describes the app-defined data that the app can later retrieve once it is activated from user taking this action. 26 | /// 27 | [NotificationXmlAttribute("arguments")] 28 | public string Arguments { get; set; } 29 | 30 | [NotificationXmlAttribute("activationType", DEFAULT_ACTIVATION_TYPE)] 31 | public Element_ToastActivationType ActivationType { get; set; } = DEFAULT_ACTIVATION_TYPE; 32 | 33 | /// 34 | /// imageUri is optional and is used to provide an image icon for this action to display inside the button alone with the text content. 35 | /// 36 | [NotificationXmlAttribute("imageUri")] 37 | public string ImageUri { get; set; } 38 | 39 | /// 40 | /// This is specifically used for the quick reply scenario. 41 | /// 42 | [NotificationXmlAttribute("hint-inputId")] 43 | public string InputId { get; set; } 44 | 45 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 46 | public Element_ToastActionPlacement Placement { get; set; } = DEFAULT_PLACEMENT; 47 | } 48 | 49 | internal enum Element_ToastActionPlacement 50 | { 51 | Inline, 52 | 53 | [EnumString("contextMenu")] 54 | ContextMenu 55 | } 56 | 57 | internal enum Element_ToastActivationType 58 | { 59 | /// 60 | /// Default value. Your foreground app is launched. 61 | /// 62 | Foreground, 63 | 64 | /// 65 | /// Your corresponding background task (assuming you set everything up) is triggered, and you can execute code in the background (like sending the user's quick reply message) without interrupting the user. 66 | /// 67 | [EnumString("background")] 68 | Background, 69 | 70 | /// 71 | /// Launch a different app using protocol activation. 72 | /// 73 | [EnumString("protocol")] 74 | Protocol, 75 | 76 | /// 77 | /// System handles the activation. 78 | /// 79 | [EnumString("system")] 80 | System 81 | } 82 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastActions.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Toasts 12 | { 13 | [NotificationXmlElement("actions")] 14 | internal sealed class Element_ToastActions 15 | { 16 | internal const ToastSystemCommand DEFAULT_SYSTEM_COMMAND = ToastSystemCommand.None; 17 | 18 | [NotificationXmlAttribute("hint-systemCommands", DEFAULT_SYSTEM_COMMAND)] 19 | public ToastSystemCommand SystemCommands { get; set; } = ToastSystemCommand.None; 20 | 21 | public IList Children { get; private set; } = new List(); 22 | } 23 | 24 | internal interface IElement_ToastActionsChild { } 25 | 26 | internal enum ToastSystemCommand 27 | { 28 | None, 29 | SnoozeAndDismiss 30 | } 31 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastAudio.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Toasts 12 | { 13 | [NotificationXmlElement("audio")] 14 | internal sealed class Element_ToastAudio 15 | { 16 | internal const bool DEFAULT_LOOP = false; 17 | internal const bool DEFAULT_SILENT = false; 18 | 19 | /// 20 | /// The media file to play in place of the default sound. This can either be a ms-winsoundevent value, or a custom ms-appx:/// or ms-appdata:/// file, or null for the default sound. 21 | /// 22 | [NotificationXmlAttribute("src")] 23 | public Uri Src { get; set; } 24 | 25 | [NotificationXmlAttribute("loop", DEFAULT_LOOP)] 26 | public bool Loop { get; set; } = DEFAULT_LOOP; 27 | 28 | /// 29 | /// True to mute the sound; false to allow the toast notification sound to play. 30 | /// 31 | [NotificationXmlAttribute("silent", DEFAULT_SILENT)] 32 | public bool Silent { get; set; } = DEFAULT_SILENT; 33 | } 34 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastBinding.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace NotificationsExtensions.Toasts 13 | { 14 | [NotificationXmlElement("binding")] 15 | internal sealed class Element_ToastBinding 16 | { 17 | public Element_ToastBinding(ToastTemplateType template) 18 | { 19 | Template = template; 20 | } 21 | 22 | [NotificationXmlAttribute("template")] 23 | public ToastTemplateType Template { get; private set; } 24 | 25 | /// 26 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language; for instance, a value of 27 | /// 28 | /// "www.website.com/images/hello.png" 29 | /// 30 | /// included in the notification becomes 31 | /// 32 | /// "www.website.com/images/hello.png?ms-scale=100&ms-contrast=standard&ms-lang=en-us" 33 | /// 34 | [NotificationXmlAttribute("addImageQuery")] 35 | public bool? AddImageQuery { get; set; } 36 | 37 | /// 38 | /// A default base URI that is combined with relative URIs in image source attributes. 39 | /// 40 | [NotificationXmlAttribute("baseUri")] 41 | public Uri BaseUri { get; set; } 42 | 43 | /// 44 | /// The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides that in visual, but can be overriden by that in text. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. See Remarks for when this value isn't specified. 45 | /// 46 | [NotificationXmlAttribute("lang")] 47 | public string Language { get; set; } 48 | 49 | 50 | public IList Children { get; private set; } = new List(); 51 | } 52 | 53 | internal interface IElement_ToastBindingChild { } 54 | 55 | 56 | internal enum ToastTemplateType 57 | { 58 | ToastGeneric, 59 | ToastImageAndText01, 60 | ToastImageAndText02, 61 | ToastImageAndText03, 62 | ToastImageAndText04, 63 | ToastText01, 64 | ToastText02, 65 | ToastText03, 66 | ToastText04 67 | } 68 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | [NotificationXmlElement("image")] 13 | internal sealed class Element_ToastImage : IElement_ToastBindingChild 14 | { 15 | internal const ToastImagePlacement DEFAULT_PLACEMENT = ToastImagePlacement.Inline; 16 | internal const bool DEFAULT_ADD_IMAGE_QUERY = false; 17 | internal const ToastImageCrop DEFAULT_CROP = ToastImageCrop.None; 18 | 19 | [NotificationXmlAttribute("src")] 20 | public string Src { get; set; } 21 | 22 | [NotificationXmlAttribute("alt")] 23 | public string Alt { get; set; } 24 | 25 | [NotificationXmlAttribute("addImageQuery", DEFAULT_ADD_IMAGE_QUERY)] 26 | public bool AddImageQuery { get; set; } = DEFAULT_ADD_IMAGE_QUERY; 27 | 28 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 29 | public ToastImagePlacement Placement { get; set; } = DEFAULT_PLACEMENT; 30 | 31 | [NotificationXmlAttribute("hint-crop", DEFAULT_CROP)] 32 | public ToastImageCrop Crop { get; set; } = DEFAULT_CROP; 33 | } 34 | 35 | /// 36 | /// Specify the desired cropping of the image. 37 | /// 38 | public enum ToastImageCrop 39 | { 40 | /// 41 | /// Default value. Image is not cropped. 42 | /// 43 | None, 44 | 45 | /// 46 | /// Image is cropped to a circle shape. 47 | /// 48 | [EnumString("circle")] 49 | Circle 50 | } 51 | 52 | 53 | internal enum ToastImagePlacement 54 | { 55 | Inline, 56 | 57 | [EnumString("appLogoOverride")] 58 | AppLogoOverride, 59 | 60 | [EnumString("hero")] 61 | Hero 62 | } 63 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastInput.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WindowsNotifications/NotificationsExtensions/08a00bbd2811124865faf06776e88df6038b0278/Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastInput.cs -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastSelection.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | [NotificationXmlElement("selection")] 13 | internal sealed class Element_ToastSelection : IElement_ToastInputChild 14 | { 15 | /// 16 | /// The id attribute is required and it is for apps to retrieve back the user selected input after the app is activated. 17 | /// 18 | [NotificationXmlAttribute("id")] 19 | public string Id { get; set; } 20 | 21 | /// 22 | /// The text to display for this selection element. 23 | /// 24 | [NotificationXmlAttribute("content")] 25 | public string Content { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | [NotificationXmlElement("text")] 13 | internal sealed class Element_ToastText : IElement_ToastBindingChild 14 | { 15 | internal const ToastTextPlacement DEFAULT_PLACEMENT = ToastTextPlacement.Inline; 16 | 17 | [NotificationXmlContent] 18 | public string Text { get; set; } 19 | 20 | [NotificationXmlAttribute("lang")] 21 | public string Lang { get; set; } 22 | 23 | [NotificationXmlAttribute("placement", DEFAULT_PLACEMENT)] 24 | public ToastTextPlacement Placement { get; set; } = DEFAULT_PLACEMENT; 25 | } 26 | 27 | internal enum ToastTextPlacement 28 | { 29 | Inline, 30 | 31 | [EnumString("attribution")] 32 | Attribution 33 | } 34 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/Elements/Element_ToastVisual.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace NotificationsExtensions.Toasts 13 | { 14 | [NotificationXmlElement("visual")] 15 | internal sealed class Element_ToastVisual 16 | { 17 | internal const bool DEFAULT_ADD_IMAGE_QUERY = false; 18 | 19 | [NotificationXmlAttribute("addImageQuery")] 20 | public bool? AddImageQuery { get; set; } 21 | 22 | [NotificationXmlAttribute("baseUri")] 23 | public Uri BaseUri { get; set; } 24 | 25 | [NotificationXmlAttribute("lang")] 26 | public string Language { get; set; } 27 | 28 | [NotificationXmlAttribute("version")] 29 | public int? Version { get; set; } 30 | 31 | public IList Bindings { get; private set; } = new List(); 32 | } 33 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastAppLogo.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Toasts 10 | { 11 | /// 12 | /// The logo that is displayed on your toast notification. 13 | /// 14 | public sealed class ToastAppLogo 15 | { 16 | /// 17 | /// Initializes a new instance of a toast app logo, which can override the logo displayed on your toast notification. 18 | /// 19 | public ToastAppLogo() { } 20 | 21 | /// 22 | /// Specify the image source. 23 | /// 24 | public ToastImageSource Source { get; set; } 25 | 26 | /// 27 | /// Specify how you would like the image to be cropped. 28 | /// 29 | public ToastImageCrop Crop { get; set; } = Element_ToastImage.DEFAULT_CROP; 30 | 31 | internal Element_ToastImage ConvertToElement() 32 | { 33 | Element_ToastImage el = new Element_ToastImage() 34 | { 35 | Placement = ToastImagePlacement.AppLogoOverride, 36 | Crop = Crop 37 | }; 38 | 39 | if (Source != null) 40 | Source.PopulateElement(el); 41 | 42 | return el; 43 | } 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastAppLogoEnums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace NotificationsExtensions.Toasts 6 | { 7 | /// 8 | /// Specify the desired cropping of the image. 9 | /// 10 | public enum ToastAppLogoCrop 11 | { 12 | /// 13 | /// Default value. Image is not cropped. 14 | /// 15 | None, 16 | 17 | /// 18 | /// Image is cropped to a circle shape. 19 | /// 20 | [EnumString("circle")] 21 | Circle 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastAudio.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | using System; 10 | 11 | namespace NotificationsExtensions.Toasts 12 | { 13 | 14 | /// 15 | /// Specify audio to be played when the toast notification is received. 16 | /// 17 | public sealed class ToastAudio 18 | { 19 | /// 20 | /// Initializes a new instance of toast audio, which specifies what audio to play when the toast notification is received. 21 | /// 22 | public ToastAudio() { } 23 | 24 | /// 25 | /// The media file to play in place of the default sound. 26 | /// 27 | public Uri Src { get; set; } 28 | 29 | /// 30 | /// Set to true if the sound should repeat as long as the toast is shown; false to play only once (default). 31 | /// 32 | public bool Loop { get; set; } = Element_ToastAudio.DEFAULT_LOOP; 33 | 34 | /// 35 | /// True to mute the sound; false to allow the toast notification sound to play (default). 36 | /// 37 | public bool Silent { get; set; } = Element_ToastAudio.DEFAULT_SILENT; 38 | 39 | internal Element_ToastAudio ConvertToElement() 40 | { 41 | return new Element_ToastAudio() 42 | { 43 | Src = Src, 44 | Loop = Loop, 45 | Silent = Silent 46 | }; 47 | } 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastContextMenuItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace NotificationsExtensions.Toasts 6 | { 7 | public sealed class ToastContextMenuItem 8 | { 9 | /// 10 | /// Initializes a toast context menu item with the required properties. 11 | /// 12 | /// The text to display on the menu item. 13 | /// App-defined string of arguments that the app can later retrieve once it is activated when the user clicks the menu item. 14 | public ToastContextMenuItem(string content, string arguments) 15 | { 16 | if (content == null) 17 | throw new ArgumentNullException("content"); 18 | 19 | if (arguments == null) 20 | throw new ArgumentNullException("arguments"); 21 | 22 | Content = content; 23 | Arguments = arguments; 24 | } 25 | 26 | /// 27 | /// Required. The text to display on the menu item. 28 | /// 29 | public string Content { get; private set; } 30 | 31 | /// 32 | /// Required. App-defined string of arguments that the app can later retrieve once it is activated when the user clicks the menu item. 33 | /// 34 | public string Arguments { get; private set; } 35 | 36 | /// 37 | /// Controls what type of activation this menu item will use when clicked. Defaults to Foreground. 38 | /// 39 | public ToastActivationType ActivationType { get; set; } = ToastActivationType.Foreground; 40 | 41 | internal Element_ToastAction ConvertToElement() 42 | { 43 | return new Element_ToastAction() 44 | { 45 | Content = Content, 46 | Arguments = Arguments, 47 | ActivationType = GetElementActivationType(), 48 | Placement = Element_ToastActionPlacement.ContextMenu 49 | }; 50 | } 51 | 52 | private Element_ToastActivationType GetElementActivationType() 53 | { 54 | switch (ActivationType) 55 | { 56 | case ToastActivationType.Foreground: 57 | return Element_ToastActivationType.Foreground; 58 | 59 | case ToastActivationType.Background: 60 | return Element_ToastActivationType.Background; 61 | 62 | case ToastActivationType.Protocol: 63 | return Element_ToastActivationType.Protocol; 64 | 65 | default: 66 | throw new NotImplementedException(); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastGenericAppLogo.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive.Elements; 9 | using System; 10 | 11 | namespace NotificationsExtensions.Toasts 12 | { 13 | /// 14 | /// The logo that is displayed on your toast notification. 15 | /// 16 | public sealed class ToastGenericAppLogo : IBaseImage 17 | { 18 | /// 19 | /// Initializes a new instance of a toast app logo, which can override the logo displayed on your toast notification. 20 | /// 21 | public ToastGenericAppLogo() { } 22 | 23 | private string _source; 24 | /// 25 | /// The URI of the image. Can be from your application package, application data, or the internet. Internet images must be less than 200 KB in size. 26 | /// 27 | public string Source 28 | { 29 | get { return _source; } 30 | set { BaseImageHelper.SetSource(ref _source, value); } 31 | } 32 | 33 | /// 34 | /// A description of the image, for users of assistive technologies. 35 | /// 36 | public string AlternateText { get; set; } 37 | 38 | /// 39 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 40 | /// 41 | public bool? AddImageQuery { get; set; } 42 | 43 | /// 44 | /// Specify how you would like the image to be cropped. 45 | /// 46 | public ToastGenericAppLogoCrop HintCrop { get; set; } 47 | 48 | internal Element_AdaptiveImage ConvertToElement() 49 | { 50 | Element_AdaptiveImage el = BaseImageHelper.CreateBaseElement(this); 51 | 52 | el.Placement = AdaptiveImagePlacement.AppLogoOverride; 53 | el.Crop = GetAdaptiveImageCrop(); 54 | 55 | return el; 56 | } 57 | 58 | private AdaptiveImageCrop GetAdaptiveImageCrop() 59 | { 60 | switch (HintCrop) 61 | { 62 | case ToastGenericAppLogoCrop.Circle: 63 | return AdaptiveImageCrop.Circle; 64 | 65 | case ToastGenericAppLogoCrop.None: 66 | return AdaptiveImageCrop.None; 67 | 68 | default: 69 | return AdaptiveImageCrop.Default; 70 | } 71 | } 72 | } 73 | 74 | 75 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastGenericAppLogoEnums.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace NotificationsExtensions.Toasts 13 | { 14 | /// 15 | /// Specify the desired cropping of the image. 16 | /// 17 | public enum ToastGenericAppLogoCrop 18 | { 19 | /// 20 | /// Cropping uses the default behavior of the renderer. 21 | /// 22 | Default, 23 | 24 | /// 25 | /// Image is not cropped. 26 | /// 27 | [EnumString("none")] 28 | None, 29 | 30 | /// 31 | /// Image is cropped to a circle shape. 32 | /// 33 | [EnumString("circle")] 34 | Circle 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastGenericAttributionText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive; 9 | using NotificationsExtensions.Adaptive.Elements; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions.Toasts 15 | { 16 | /// 17 | /// Defines an attribution text element to be displayed on the toast notification. 18 | /// 19 | public sealed class ToastGenericAttributionText : IBaseText 20 | { 21 | /// 22 | /// Constructs a new attribution text element that can be displayed on a toast notification. 23 | /// 24 | public ToastGenericAttributionText() { } 25 | 26 | /// 27 | /// The text to display. 28 | /// 29 | public string Text { get; set; } 30 | 31 | /// 32 | /// The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. 33 | /// 34 | public string Language { get; set; } 35 | 36 | internal Element_AdaptiveText ConvertToElement() 37 | { 38 | var el = BaseTextHelper.CreateBaseElement(this); 39 | 40 | el.Placement = AdaptiveTextPlacement.Attribution; 41 | 42 | return el; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastGenericHeroImage.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using NotificationsExtensions.Adaptive; 9 | using NotificationsExtensions.Adaptive.Elements; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace NotificationsExtensions.Toasts 15 | { 16 | /// 17 | /// Constructs a hero image for the toast notification. 18 | /// 19 | public sealed class ToastGenericHeroImage : IBaseImage 20 | { 21 | /// 22 | /// Constructs a hero image for the toast notification. 23 | /// 24 | public ToastGenericHeroImage() { } 25 | 26 | private string _source; 27 | /// 28 | /// The URI of the image. Can be from your application package, application data, or the internet. Internet images must be less than 200 KB in size. 29 | /// 30 | public string Source 31 | { 32 | get { return _source; } 33 | set { BaseImageHelper.SetSource(ref _source, value); } 34 | } 35 | 36 | /// 37 | /// A description of the image, for users of assistive technologies. 38 | /// 39 | public string AlternateText { get; set; } 40 | 41 | /// 42 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 43 | /// 44 | public bool? AddImageQuery { get; set; } 45 | 46 | internal Element_AdaptiveImage ConvertToElement() 47 | { 48 | Element_AdaptiveImage el = BaseImageHelper.CreateBaseElement(this); 49 | 50 | el.Placement = AdaptiveImagePlacement.Hero; 51 | 52 | return el; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace NotificationsExtensions.Toasts 6 | { 7 | /// 8 | /// An inline image displayed in your toast notification. 9 | /// 10 | public sealed class ToastImage 11 | { 12 | /// 13 | /// Constructs an inline image that can be displayed on a toast notification. 14 | /// 15 | public ToastImage() { } 16 | 17 | /// 18 | /// Specify the image source. 19 | /// 20 | public ToastImageSource Source { get; set; } 21 | 22 | internal Element_ToastImage ConvertToElement() 23 | { 24 | Element_ToastImage el = new Element_ToastImage() 25 | { 26 | Placement = ToastImagePlacement.Inline 27 | }; 28 | 29 | if (Source != null) 30 | Source.PopulateElement(el); 31 | 32 | return el; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastImageSource.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | /// 13 | /// Defines a toast image source and related properties. 14 | /// 15 | public sealed class ToastImageSource 16 | { 17 | /// 18 | /// Constructs an image source with all the required properties. 19 | /// 20 | /// The URI of the image source. Can be from your application package, application data, or the internet. 21 | public ToastImageSource(string src) 22 | { 23 | if (src == null) 24 | throw new ArgumentNullException("src"); 25 | 26 | Src = src; 27 | } 28 | 29 | /// 30 | /// The URI of the image source. Can be from your application package, application data, or the internet. 31 | /// 32 | public string Src { get; private set; } 33 | 34 | /// 35 | /// A description of the image, for users of assistive technologies. 36 | /// 37 | public string Alt { get; set; } 38 | 39 | /// 40 | /// Set to true to allow Windows to append a query string to the image URI supplied in the tile notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language. 41 | /// 42 | public bool AddImageQuery { get; set; } = Element_ToastImage.DEFAULT_ADD_IMAGE_QUERY; 43 | 44 | internal Element_ToastImage ConvertToElement() 45 | { 46 | Element_ToastImage image = new Element_ToastImage(); 47 | 48 | PopulateElement(image); 49 | 50 | return image; 51 | } 52 | 53 | internal void PopulateElement(Element_ToastImage image) 54 | { 55 | image.Src = Src; 56 | image.Alt = Alt; 57 | image.AddImageQuery = AddImageQuery; 58 | } 59 | 60 | /// 61 | /// Returns the value of the Src property. 62 | /// 63 | /// 64 | public override string ToString() 65 | { 66 | return Src; 67 | } 68 | } 69 | 70 | 71 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastSelectionBox.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace NotificationsExtensions.Toasts 12 | { 13 | /// 14 | /// A selection box control, which lets users pick from a dropdown list of options. 15 | /// 16 | public sealed class ToastSelectionBox : IToastInput 17 | { 18 | /// 19 | /// Initializes a new toast SelectionBox input control with the required elements. 20 | /// 21 | /// Developer-provided ID that the developer uses later to retrieve input when the toast is interacted with. 22 | public ToastSelectionBox(string id) 23 | { 24 | if (id == null) 25 | throw new ArgumentNullException("id"); 26 | 27 | Id = id; 28 | } 29 | 30 | /// 31 | /// The ID property is required, and is used so that developers can retrieve user input once the app is activated. 32 | /// 33 | public string Id { get; private set; } 34 | 35 | /// 36 | /// Title text to display above the SelectionBox. 37 | /// 38 | public string Title { get; set; } 39 | 40 | /// 41 | /// This controls which item is selected by default, and refers to the Id property of . If you do not provide this, the default selection will be empty (user sees nothing). 42 | /// 43 | public string DefaultSelectionBoxItemId { get; set; } 44 | 45 | /// 46 | /// The selection items that the user can pick from in this SelectionBox. Only 5 items can be added. 47 | /// 48 | public IList Items { get; private set; } = new LimitedList(5); 49 | 50 | internal Element_ToastInput ConvertToElement() 51 | { 52 | var input = new Element_ToastInput() 53 | { 54 | Type = ToastInputType.Selection, 55 | Id = Id, 56 | DefaultInput = DefaultSelectionBoxItemId, 57 | Title = Title 58 | }; 59 | 60 | foreach (var item in Items) 61 | input.Children.Add(item.ConvertToElement()); 62 | 63 | return input; 64 | } 65 | } 66 | 67 | 68 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastSelectionBoxItem.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | /// 13 | /// A selection box item (an item that the user can select from the drop down list). 14 | /// 15 | public sealed class ToastSelectionBoxItem 16 | { 17 | /// 18 | /// Constructs a new toast SelectionBoxItem with the required elements. 19 | /// 20 | /// Developer-provided ID that the developer uses later to retrieve input when the toast is interacted with. 21 | /// String that is displayed on the selection item. This is what the user sees. 22 | public ToastSelectionBoxItem(string id, string content) 23 | { 24 | if (id == null) 25 | throw new ArgumentNullException("id"); 26 | 27 | if (content == null) 28 | throw new ArgumentNullException("content"); 29 | 30 | Id = id; 31 | Content = content; 32 | } 33 | 34 | /// 35 | /// The ID property is required, and is used so that developers can retrieve user input once the app is activated. 36 | /// 37 | public string Id { get; private set; } 38 | 39 | /// 40 | /// The Content property is required, and is a string that is displayed on the selection item. 41 | /// 42 | public string Content { get; private set; } 43 | 44 | internal Element_ToastSelection ConvertToElement() 45 | { 46 | return new Element_ToastSelection() 47 | { 48 | Id = Id, 49 | Content = Content 50 | }; 51 | } 52 | } 53 | 54 | 55 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastText.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | 9 | namespace NotificationsExtensions.Toasts 10 | { 11 | /// 12 | /// Defines a text element to be displayed on the toast notification. 13 | /// 14 | public sealed class ToastText 15 | { 16 | /// 17 | /// Constructs a new text element that can be displayed on a toast notification. 18 | /// 19 | public ToastText() { } 20 | 21 | /// 22 | /// The text to display. 23 | /// 24 | public string Text { get; set; } 25 | 26 | /// 27 | /// The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. 28 | /// 29 | public string Language { get; set; } 30 | 31 | internal Element_ToastText ConvertToElement() 32 | { 33 | return new Element_ToastText() 34 | { 35 | Text = Text, 36 | Lang = Language 37 | }; 38 | } 39 | } 40 | 41 | 42 | } -------------------------------------------------------------------------------- /Windows 10/NotificationsExtensions/Toasts/ToastTextBox.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | using System; 9 | 10 | namespace NotificationsExtensions.Toasts 11 | { 12 | /// 13 | /// A text box control on the toast that a user can type text into. 14 | /// 15 | public sealed class ToastTextBox : IToastInput 16 | { 17 | /// 18 | /// Initializes a new toast TextBox input control with the required elements. 19 | /// 20 | /// Developer-provided ID that the developer uses later to retrieve input when the toast is interacted with. 21 | public ToastTextBox(string id) 22 | { 23 | if (id == null) 24 | throw new ArgumentNullException("id"); 25 | 26 | Id = id; 27 | } 28 | 29 | /// 30 | /// The ID property is required, and is used so that developers can retrieve user input once the app is activated. 31 | /// 32 | public string Id { get; private set; } 33 | 34 | /// 35 | /// Title text to display above the text box. 36 | /// 37 | public string Title { get; set; } 38 | 39 | /// 40 | /// Placeholder text to be displayed on the text box when the user hasn't typed any text yet. 41 | /// 42 | public string PlaceholderContent { get; set; } 43 | 44 | /// 45 | /// The initial text to place in the text box. Leave this null for a blank text box. 46 | /// 47 | public string DefaultInput { get; set; } 48 | 49 | internal Element_ToastInput ConvertToElement() 50 | { 51 | return new Element_ToastInput() 52 | { 53 | Id = Id, 54 | Type = ToastInputType.Text, 55 | DefaultInput = DefaultInput, 56 | PlaceholderContent = PlaceholderContent, 57 | Title = Title 58 | }; 59 | } 60 | } 61 | 62 | 63 | } -------------------------------------------------------------------------------- /Windows 10/README.md: -------------------------------------------------------------------------------- 1 | ## NotificationsExtensions for Windows 10 2 | 3 | This is the Windows 10 version of NotificationsExtensions. Andrew Bares, a PM on the Notifications team at Microsoft, re-wrote the existing NotificationsExtensions library, adding support for the new adaptive tiles and adaptive/interactive toast notifications in Windows 10. 4 | 5 | ### Getting Started 6 | 7 | 1. Clone this repository to your local hard drive 8 | 2. Open your own project (Windows 10 app, server code, etc) 9 | 3. **If you're writing a Windows 10 app, reference "Windows 10" -> "NotificationsExtensions.Win10.WinRT"** 10 | 4. If you're writing a server app (non-WinRT), reference "Windows 10" -> "NotificationsExtensions.Win10.Portable" 11 | 5. After the project is referenced, the namespace is "NotificationsExtensions" and each category of notifications are under their own namespace like "NotificationsExtensions.Tiles" or "Toasts" or "Badges". 12 | 13 | 14 | ### How to use it 15 | 16 | Please [read our Wiki](https://github.com/anbare/NotificationsExtensions/wiki) to learn how to use NotificationsExtensions. 17 | -------------------------------------------------------------------------------- /Windows 8.1 RT/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 8.1 RT/NotificationsExtensions.WinRT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationsExtensions.WinRT", "NotificationsExtensions.WinRT\NotificationsExtensions.WinRT.csproj", "{9EB94075-F103-4DB6-97F0-18D8EE82F41A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Debug|ARM = Debug|ARM 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|Any CPU = Release|Any CPU 13 | Release|ARM = Release|ARM 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|ARM.ActiveCfg = Debug|ARM 21 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|ARM.Build.0 = Debug|ARM 22 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|x64.ActiveCfg = Debug|x64 23 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|x64.Build.0 = Debug|x64 24 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|x86.ActiveCfg = Debug|x86 25 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Debug|x86.Build.0 = Debug|x86 26 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|ARM.ActiveCfg = Release|ARM 29 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|ARM.Build.0 = Release|ARM 30 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|x64.ActiveCfg = Release|x64 31 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|x64.Build.0 = Release|x64 32 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|x86.ActiveCfg = Release|x86 33 | {9EB94075-F103-4DB6-97F0-18D8EE82F41A}.Release|x86.Build.0 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /Windows 8.1 RT/NotificationsExtensions.WinRT/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Windows 8.1 RT/NotificationsExtensions.WinRT/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NotificationsExtensions.WinRT")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NotificationsExtensions.WinRT")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Windows 8.1 RT/README.md: -------------------------------------------------------------------------------- 1 | ## WARNING: Old Version 2 | 3 | This is the old version of NotificationsExtensions written for Windows 8.1. I have simply included this code from the previous author. I have not made any changes to it. It is here for legacy purposes. I do not recommend using this in Windows 10 apps; instead, please download the Windows 10 version that supports adaptive and interactive. 4 | --------------------------------------------------------------------------------