From 397409a3a46d3ace7b84f4a6b38226fa5f4038df Mon Sep 17 00:00:00 2001 From: ChrisK91 Date: Sat, 7 Sep 2013 14:19:14 +0200 Subject: [PATCH] Added ability to pin user profiles - Changed background agent to only update primary tile - Added TilesCreator class that takes care of creating tiles - Added ShellTileExtension to use the ShellTile.Create(Uri, ShellTileData,Bool) overload --- SparklrWP Background Agent/ScheduledAgent.cs | 19 +- SparklrWP/Assets/TileBackgrounds/Medium.png | Bin 0 -> 1057 bytes SparklrWP/Assets/TileBackgrounds/Small.png | Bin 0 -> 507 bytes SparklrWP/Assets/TileBackgrounds/Wide.png | Bin 0 -> 1173 bytes SparklrWP/Pages/Profile.xaml | 11 ++ SparklrWP/Pages/Profile.xaml.cs | 22 ++- SparklrWP/SparklrWP.csproj | 6 + SparklrWP/Utils/ShellTileExtensions.cs | 16 ++ SparklrWP/Utils/TilesCreator.cs | 189 +++++++++++++++++++ 9 files changed, 254 insertions(+), 9 deletions(-) create mode 100644 SparklrWP/Assets/TileBackgrounds/Medium.png create mode 100644 SparklrWP/Assets/TileBackgrounds/Small.png create mode 100644 SparklrWP/Assets/TileBackgrounds/Wide.png create mode 100644 SparklrWP/Utils/ShellTileExtensions.cs create mode 100644 SparklrWP/Utils/TilesCreator.cs diff --git a/SparklrWP Background Agent/ScheduledAgent.cs b/SparklrWP Background Agent/ScheduledAgent.cs index 45824d5..b6e7bdf 100644 --- a/SparklrWP Background Agent/ScheduledAgent.cs +++ b/SparklrWP Background Agent/ScheduledAgent.cs @@ -125,12 +125,19 @@ protected async override void OnInvoke(ScheduledTask task) foreach (ShellTile til in ShellTile.ActiveTiles) { - Mangopollo.Tiles.FlipTileData data = new Mangopollo.Tiles.FlipTileData(); - data.Title = "Sparklr*"; - data.Title = "Sparklr*"; - data.BackgroundImage = new Uri("/Background.png", UriKind.Relative); - data.BackBackgroundImage = new Uri("http://til.eaterofcorps.es/?url=http%3A%2F%2Fd.sparklr.me%2Fi%2F" + strm.notifications[0].from + ".jpg&text=" + Uri.EscapeDataString(String.Format(textGenerator(strm.notifications[0]), client.Usernames[strm.notifications[0].from]))); - til.Update(data); + //Update only primary tile + if (til.NavigationUri.ToString() == "/") + { + Mangopollo.Tiles.FlipTileData data = new Mangopollo.Tiles.FlipTileData(); + data.Title = "Sparklr*"; + data.Title = "Sparklr*"; + data.BackgroundImage = new Uri("/Background.png", UriKind.Relative); + data.BackBackgroundImage = new Uri("http://til.eaterofcorps.es/?url=http%3A%2F%2Fd.sparklr.me%2Fi%2F" + strm.notifications[0].from + ".jpg&text=" + Uri.EscapeDataString(String.Format(textGenerator(strm.notifications[0]), client.Usernames[strm.notifications[0].from]))); + til.Update(data); + + //We can only have one primary tily --> break + break; + } } foreach (Notification not in strm.notifications) diff --git a/SparklrWP/Assets/TileBackgrounds/Medium.png b/SparklrWP/Assets/TileBackgrounds/Medium.png new file mode 100644 index 0000000000000000000000000000000000000000..f343a3011af7d893065747062a6572e03cffe571 GIT binary patch literal 1057 zcmeAS@N?(olHy`uVBq!ia0y~yUGZx^prwfgF}}M_)$< zhK>E)e-c?47?>FXd_r7feKUYkqhK@yMrH_PIaYiE`kb@CBeIx*f$uN~Gak=hkpdKy zDshb{3C>R|DNig)We7;j%q!9Ja}7}_GuAWJGc+*xQnV1Ls>RdAF{C2y?LkIfAn(wE j@BX>`>?}Yg{lNFEUGWTz505CX0NLs3>gTe~DWM4f$bT~# literal 0 HcmV?d00001 diff --git a/SparklrWP/Assets/TileBackgrounds/Small.png b/SparklrWP/Assets/TileBackgrounds/Small.png new file mode 100644 index 0000000000000000000000000000000000000000..e57d7e605721538438da3a4c58b9db480c75dca7 GIT binary patch literal 507 zcmeAS@N?(olHy`uVBq!ia0vp^b3mAb2}rWu3Y7v63>2Bo$TkB=F%}28J29*~C-V}>VM%xN zb!1@J*w6hZk(GggnIXU@#5LA811L2LMnhm^hCr5M#V4T8ISV`@iy0XB4ude`@%$Aj zKtZVz*NBqf{Irtt#G+J&fW*wa5hJyShH1A{L`3xTSBc)B=-RK&eKXvhfU l9a`|!KbJjU0mvNQfX}oimx0kTr-vWpPfu4rmvv4FO#tEHFopmC literal 0 HcmV?d00001 diff --git a/SparklrWP/Pages/Profile.xaml b/SparklrWP/Pages/Profile.xaml index d277782..f304001 100644 --- a/SparklrWP/Pages/Profile.xaml +++ b/SparklrWP/Pages/Profile.xaml @@ -135,6 +135,17 @@ + + + + + + + + + + +