Skip to content

Commit fa96904

Browse files
authored
Remove NotificationsVisualizerLibrary from sample app (#4259)
The NotificationsVisualizerLibrary is being deprecated/no longer updated, and we really don't need this dependency. Replacing the previews with static images/GIFs so that there are still previews of the toasts/tiles without affecting sample functionality.
1 parent 7816189 commit fa96904

14 files changed

+76
-181
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@
119119
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
120120
<Version>2.0.1</Version>
121121
</PackageReference>
122-
<PackageReference Include="NotificationsVisualizerLibrary">
123-
<Version>1.0.5</Version>
124-
</PackageReference>
125122
<PackageReference Include="System.ValueTuple">
126123
<Version>4.5.0</Version>
127124
</PackageReference>
@@ -142,6 +139,8 @@
142139
<Content Include="Assets\NotificationAssets\Mostly Cloudy-Background.jpg" />
143140
<Content Include="Assets\NotificationAssets\Mostly Cloudy-Square.png" />
144141
<Content Include="Assets\NotificationAssets\Mostly Cloudy.png" />
142+
<Content Include="Assets\NotificationAssets\SampleLiveTiles.gif" />
143+
<Content Include="Assets\NotificationAssets\SampleToast.gif" />
145144
<Content Include="Assets\NotificationAssets\Slight Drizzle-Square.png" />
146145
<Content Include="Assets\NotificationAssets\Slight Drizzle.png" />
147146
<Content Include="Assets\NotificationAssets\Snow-Square.png" />
@@ -150,6 +149,11 @@
150149
<Content Include="Assets\NotificationAssets\Sunny.png" />
151150
<Content Include="Assets\NotificationAssets\Thunderstorms-Square.png" />
152151
<Content Include="Assets\NotificationAssets\Thunderstorms.png" />
152+
<Content Include="Assets\NotificationAssets\WeatherTileLarge.png" />
153+
<Content Include="Assets\NotificationAssets\WeatherTileMedium.png" />
154+
<Content Include="Assets\NotificationAssets\WeatherTileSmall.png" />
155+
<Content Include="Assets\NotificationAssets\WeatherTileWide.png" />
156+
<Content Include="Assets\NotificationAssets\WeatherToast.png" />
153157
<Content Include="Assets\People\dave.png" />
154158
<Content Include="Assets\People\david.png" />
155159
<Content Include="Assets\People\giorgio.png" />
@@ -1562,4 +1566,4 @@
15621566
</Target>
15631567
<!-- No-op to avoid build error when packing solution from commandline -->
15641568
<Target Name="Pack" />
1565-
</Project>
1569+
</Project>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/LiveTile/LiveTilePage.xaml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:visualizer="using:NotificationsVisualizerLibrary"
7-
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
86
mc:Ignorable="d">
97

108
<Page.Resources>
@@ -23,7 +21,8 @@
2321
Margin="20,20,20,0"
2422
HorizontalAlignment="Stretch"
2523
Click="ButtonPinTile_Click"
26-
Content="Pin Tile" />
24+
Content="Pin Tile"
25+
Style="{ThemeResource AccentButtonStyle}" />
2726

2827
<RichTextBlock Margin="20,10,20,0">
2928
<Paragraph>Click the button to pin a secondary tile and send a notification to the tile, displaying rich visual content. The previews below show you what the tile will look like when you pin it.</Paragraph>
@@ -35,52 +34,10 @@
3534
</Paragraph>
3635
</RichTextBlock>
3736

38-
<controls:WrapPanel
39-
Margin="18"
40-
HorizontalAlignment="Center">
41-
42-
<StackPanel
43-
HorizontalAlignment="Center"
44-
Padding="20"
45-
Background="{ThemeResource Brush-Grey-04}"
46-
Margin="10">
47-
<TextBlock
48-
Text="MEDIUM"
49-
Style="{StaticResource Box-Header}" />
50-
<visualizer:PreviewTile x:Name="MediumPreviewTile"
51-
IsAnimationEnabled="False"
52-
TileSize="Medium"
53-
HorizontalAlignment="Center" />
54-
</StackPanel>
55-
56-
<StackPanel
57-
HorizontalAlignment="Center"
58-
Padding="20"
59-
Background="{ThemeResource Brush-Grey-04}"
60-
Margin="10">
61-
<TextBlock
62-
Text="WIDE"
63-
Style="{StaticResource Box-Header}" />
64-
<visualizer:PreviewTile x:Name="WidePreviewTile"
65-
IsAnimationEnabled="False"
66-
TileSize="Wide"
67-
HorizontalAlignment="Center" />
68-
</StackPanel>
69-
70-
<StackPanel
71-
HorizontalAlignment="Center"
72-
Padding="20"
73-
Background="{ThemeResource Brush-Grey-04}"
74-
Margin="10">
75-
<TextBlock
76-
Text="LARGE"
77-
Style="{StaticResource Box-Header}" />
78-
<visualizer:PreviewTile x:Name="LargePreviewTile"
79-
IsAnimationEnabled="False"
80-
TileSize="Large"
81-
HorizontalAlignment="Center" />
82-
</StackPanel>
83-
</controls:WrapPanel>
37+
<Border Background="{ThemeResource Brush-Grey-04}" Padding="20" HorizontalAlignment="Center" Margin="18">
38+
<Image Source="ms-appx:///Assets/NotificationAssets/SampleLiveTiles.gif" Width="400"/>
39+
</Border>
40+
8441
</StackPanel>
8542
</ScrollViewer>
8643
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/LiveTile/LiveTilePage.xaml.cs

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,18 @@
55
using System;
66
using Microsoft.Toolkit.Uwp.Notifications;
77
using Microsoft.Toolkit.Uwp.SampleApp.Common;
8-
using Microsoft.Toolkit.Uwp.SampleApp.Models;
9-
using NotificationsVisualizerLibrary;
108
using Windows.UI.Notifications;
119
using Windows.UI.StartScreen;
1210
using Windows.UI.Xaml;
1311
using Windows.UI.Xaml.Controls;
14-
using Windows.UI.Xaml.Navigation;
1512

1613
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1714
{
1815
public sealed partial class LiveTilePage : Page
1916
{
20-
private TileContent _tileContent;
21-
2217
public LiveTilePage()
2318
{
2419
InitializeComponent();
25-
Initialize();
2620
}
2721

2822
public static TileContent GenerateTileContent(string username, string avatarLogoSource)
@@ -149,31 +143,9 @@ private async void PinTile()
149143
return;
150144
}
151145

152-
TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(new TileNotification(_tileContent.GetXml()));
153-
}
154-
155-
private void Initialize()
156-
{
157-
// Generate the tile notification content
158-
_tileContent = GenerateTileContent("MasterHip", "Assets/Photos/Owl.jpg");
159-
160-
// Prepare and update the preview tiles
161-
var previewTiles = new PreviewTile[] { MediumPreviewTile, WidePreviewTile, LargePreviewTile };
162-
foreach (var tile in previewTiles)
163-
{
164-
tile.DisplayName = "Xbox";
165-
tile.VisualElements.BackgroundColor = Constants.ApplicationBackgroundColor;
166-
tile.VisualElements.ShowNameOnSquare150x150Logo = true;
167-
tile.VisualElements.ShowNameOnSquare310x310Logo = true;
168-
tile.VisualElements.ShowNameOnWide310x150Logo = true;
169-
tile.VisualElements.Square44x44Logo = Constants.Square44x44Logo;
170-
tile.VisualElements.Square150x150Logo = Constants.Square150x150Logo;
171-
tile.VisualElements.Wide310x150Logo = Constants.Wide310x150Logo;
172-
tile.VisualElements.Square310x310Logo = Constants.Square310x310Logo;
173-
_ = tile.UpdateAsync(); // Commit changes (no need to await)
174-
175-
tile.CreateTileUpdater().Update(new TileNotification(_tileContent.GetXml()));
176-
}
146+
// Generate the tile notification content and update the tile
147+
TileContent content = GenerateTileContent("MasterHip", "Assets/Photos/Owl.jpg");
148+
TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(new TileNotification(content.GetXml()));
177149
}
178150
}
179151
}

0 commit comments

Comments
 (0)