WeatherInformation WP8: MapPage improvements
[CSharpForFun/.git] / WindowsPhone / WP8 / WeatherInformation / WeatherInformation / MainPage.xaml.cs
index 8c2b9cf..90589a0 100644 (file)
@@ -11,6 +11,7 @@ using WeatherInformation.Resources;
 using WeatherInformation.ViewModels;
 using System.Threading.Tasks;
 using WeatherInformation.Model.JsonDataParser;
+using Microsoft.Phone.Shell;
 
 namespace WeatherInformation
 {
@@ -36,6 +37,8 @@ namespace WeatherInformation
         {
             base.OnNavigatedTo(e);
 
+            CreateFlipTile();
+
             // If _isNewPageInstance is true, the page constuctor has been called, so
             // state may need to be restored.
             if (_isNewPageInstance)
@@ -171,6 +174,22 @@ namespace WeatherInformation
             NavigationService.Navigate(new Uri("/SettingsPage.xaml", UriKind.Relative));
         }
 
+        private void CreateFlipTile()
+        {
+            ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault(
+                x => x.NavigationUri.ToString().Contains("flip"));
+            tile = ShellTile.ActiveTiles.First();
+            var activeTiles = ShellTile.ActiveTiles;
+
+            var tileData = new FlipTileData();
+            tileData.Title = "GUSTAVO RULES";
+            tileData.BackTitle = "Gustavo Rules Back";
+            tileData.BackContent = "Gustavo Back Content";
+            tileData.WideBackContent = "Gustavo Wid Back Content";
+            tile.Update(tileData);
+
+        }
+
         // Código de ejemplo para compilar una ApplicationBar traducida
         //private void BuildLocalizedApplicationBar()
         //{