// Update the live tile private void UpdateLiveTile() { UnityApp.BeginInvoke(() => { var gameManager = GameManager.Instance; // Get our GameManager class from Unity if (gameManager == null) { Debug.WriteLine("Gamemanager not found in Unity project"); return; } var score = GameManager.Instance.GetScore(); ShellTile oTile = ShellTile.ActiveTiles.FirstOrDefault(); if (oTile != null) { var backContent = "Score : " + score; var wideBackContent = "Score : " + score; var tileData = new FlipTileData() { BackTitle = "Score", BackContent = backContent, Count = 0, WideBackContent = wideBackContent, WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative) }; oTile.Update(tileData); } }); }
private void TextBlock_Tap(object sender, System.Windows.Input.GestureEventArgs e) { try { ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("Flip".ToString())); TileToFind.Delete(); FlipTileData tileData = new FlipTileData { BackgroundImage = new Uri("Icons/runNew.png", UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri("Icons/wideRun.png", UriKind.RelativeOrAbsolute) }; ShellTile.Create(new Uri("/MainPage.xaml?Flip", UriKind.Relative), tileData, true); } catch (Exception ex) { FlipTileData tileData = new FlipTileData { BackgroundImage = new Uri("Icons/runNew.png", UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri("Icons/wideRun.png", UriKind.RelativeOrAbsolute) }; ShellTile.Create(new Uri("/MainPage.xaml?Flip", UriKind.Relative), tileData, true); } }
public static void UpdateTile() { // in debug mode, we don't update the tile as we check the tile through isolated storage string imagePath = null; try { using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { var names = store.GetFileNames(imageFolderPath + imagePrefix + "*" + imageExt); #if DEBUG imagePath = imageFolderPath + names[(DateTime.Now.Minute) % names.Length]; // get the file round robin on a 1 minutes basis #else imagePath = imageFolderPath + names[(DateTime.Now.Minute / 30 + DateTime.Now.Hour * 2) % names.Length]; // get the file round robin on a 30 minutes basis #endif } } catch { imagePath = null; } if (string.IsNullOrEmpty(imagePath)) return; var flipTile = new FlipTileData(); flipTile.BackTitle = ""; flipTile.BackContent = ""; flipTile.BackBackgroundImage = new Uri("isostore:/" + imagePath, UriKind.Absolute); InternalUpdateTile(flipTile); }
public void StartLiveTile(UserData userData) { try { var tileToFind = ShellTile.ActiveTiles.First(); if ( tileToFind != null ) { var newTileData = new FlipTileData { Title = "", Count = 0, BackTitle = "", BackBackgroundImage = new Uri("/TileAssets/tile.png", UriKind.RelativeOrAbsolute), WideBackBackgroundImage = new Uri("/TileAssets/tile.png", UriKind.RelativeOrAbsolute), }; newTileData.BackContent = "Coding " + userData.ActivityPercentage.Coding + "%" + Environment.NewLine + "Debugging " + userData.ActivityPercentage.Debugging + "%" + Environment.NewLine + "Building " + userData.ActivityPercentage.Building + "%"; tileToFind.Update(newTileData); } } catch ( Exception ) { } }
public static void PostDownload(IList <Feed> downloadedFeeds) { if (downloadedFeeds != null && downloadedFeeds.Count > 0) { var dbContext = new PersistentManager(); var downloadedFileName = string.Format("{0}-{1}.dat", AppConfig.TEMP_DOWNLOAD_FILE_PATTERN, DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss-tt")); if (dbContext.UpdateSerializedCopy(downloadedFeeds, downloadedFileName, false)) { if (AppConfig.ShowBackgroundUpdateResult) { ShellToast toast = new ShellToast(); toast.Title = "duyệt báo"; toast.Content = string.Format("tải {0} tin từ {1} mục", downloadedFeeds.Sum(f => f.Items.Count).ToString(), downloadedFeeds.Count); toast.Show(); } FlipTileData flipTileData = new FlipTileData() { Count = downloadedFeeds.Sum(f => f.Items.Count), BackContent = string.Format("tải {0} tin", downloadedFeeds.Sum(f => f.Items.Count)).ToString(), BackTitle = string.Format("cập nhật {0} mục", downloadedFeeds.Count), BackBackgroundImage = new Uri("Resources/tile-med-back.png", UriKind.Relative) }; ShellTile appTile = ShellTile.ActiveTiles.First(); if (appTile != null) { appTile.Update(flipTileData); } } } }
private void btnFlipTile_Click() { // find the tile object for the application tile that using "flip" contains string in it. ShellTile oTile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("flip".ToString())); if (oTile != null && oTile.NavigationUri.ToString().Contains("flip")) { FlipTileData oFliptile = new FlipTileData(); oFliptile.Title = ""; oFliptile.Count = 0; oFliptile.BackTitle = "YAMI"; oFliptile.BackContent = ""; oFliptile.WideBackContent = "Elige tus Frutas Frescas"; oFliptile.SmallBackgroundImage = new Uri("Assets/LosTiles/chico.png", UriKind.Relative); oFliptile.BackgroundImage = new Uri("Assets/LosTiles/medio3.png", UriKind.Relative); oFliptile.WideBackgroundImage = new Uri("Assets/LosTiles/grande.png", UriKind.Relative); oFliptile.BackBackgroundImage = new Uri("/Assets/LosTiles/medio2.png", UriKind.Relative); oFliptile.WideBackBackgroundImage = new Uri("/Assets/LosTiles/grande2.png", UriKind.Relative); //oFliptile.BackBackgroundImage = new Uri("/Assets/LosTiles/medio1.png", UriKind.Relative); oTile.Update(oFliptile); //MessageBox.Show("Flip Tile Data successfully update."); } else { // once it is created flip tile Uri tileUri = new Uri("/MainPage.xaml?tile=flip", UriKind.Relative); ShellTileData tileData = this.CreateFlipTileData(); ShellTile.Create(tileUri, tileData, true); } }
void tileMenuItem_Click(object sender, EventArgs e) { try { App.TrackEvent("ViewMovie", "Create tile"); if (StorageController.doesFileExist(App.MovieViewModel.Imdb + "background.jpg")) { ImageController.copyImageToShellContent(App.MovieViewModel.Imdb + "background.jpg", App.MovieViewModel.Imdb); FlipTileData NewTileData = new FlipTileData { BackgroundImage = new Uri("isostore:/Shared/ShellContent/wptraktbg" + App.MovieViewModel.Imdb + ".jpg", UriKind.Absolute), WideBackgroundImage = new Uri("isostore:/Shared/ShellContent/wptraktbg" + App.MovieViewModel.Imdb + ".jpg", UriKind.Absolute), Title = App.MovieViewModel.Name, }; ShellTile.Create( new Uri( "/ViewMovie.xaml?id=" + App.MovieViewModel.Imdb, UriKind.Relative), NewTileData, true); } } catch (InvalidOperationException) { ToastNotification.ShowToast("Tile", "Error creating tile, please try again!"); } }
private void PinToStart() { var coordinate = CurrentPosition; var deepLink = string.Format(CultureInfo.InvariantCulture, "/ShowPosition?p={0}&z={1}", Uri.EscapeDataString(coordinate.ToString()), Uri.EscapeDataString(ZoomLevel.ToStringInvariantCulture())); var navigationUri = new Uri(deepLink, UriKind.Relative); if (ShellTile.ActiveTiles.Any(x => x.NavigationUri == navigationUri)) { return; } var zoomLevel = (int)Math.Ceiling(ZoomLevel); var liveTile = new FlipTileData { SmallBackgroundImage = _hereMapsService.BuildTileUri(coordinate.Latitude, coordinate.Longitude, 159, 159, zoomLevel), BackgroundImage = _hereMapsService.BuildTileUri(coordinate.Latitude, coordinate.Longitude, 336, 336, zoomLevel), WideBackgroundImage = _hereMapsService.BuildTileUri(coordinate.Latitude, coordinate.Longitude, 691, 336, zoomLevel), BackContent = coordinate.ToString(), BackTitle = "The Other Side" }; ShellTile.Create(navigationUri, liveTile, true); }
public static void DefaultAllSettings() { IsolatedStorageSettings.ApplicationSettings["topup"] = true; IsolatedStorageSettings.ApplicationSettings["defaultnumber"] = string.Empty; IsolatedStorageSettings.ApplicationSettings["defaulttopupvalue"] = 15; IsolatedStorageSettings.ApplicationSettings["lastusedsim"] = false; IsolatedStorageSettings.ApplicationSettings["sim"] = string.Empty; IsolatedStorageSettings.ApplicationSettings["tileAccentColor"] = true; IsolatedStorageSettings.ApplicationSettings["oldtilestyle"] = false; var newTile = new FlipTileData { BackContent = string.Empty, Count = 0, BackBackgroundImage = new Uri("/Assets/336x336empty.png", UriKind.Relative) }; var firstOrDefault = ShellTile.ActiveTiles.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.Update(newTile); } ResetLiveTile(); //remove all background tasks. foreach (var pt in ScheduledActionService.GetActions <PeriodicTask>()) { ScheduledActionService.Remove(pt.Name); } }
// Constructor public MainPage() { InitializeComponent(); DataPlace dp = new DataPlace(); dp.Main(); Application.Current.Host.Settings.EnableFrameRateCounter = false; //longlist.ItemsSource = dp.d; pagename.Text = "Smile :)"; ScheduleTile(); ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault(); if (tile != null) { FlipTileData flipTile = new FlipTileData(); flipTile.Title = "Be happy "; flipTile.BackTitle = "Enjoy !"; //Medium size Tile 336x336 px flipTile.BackContent = "Be happy for this moment. This moment is your life."; flipTile.BackgroundImage = new Uri("/Assets/life_is_happiness.jpg", UriKind.Relative); flipTile.BackBackgroundImage = new Uri("/Assets/Degradation-Background.jpg", UriKind.Relative); //Wide size Tile 691x336 px flipTile.WideBackgroundImage = new Uri("/Assets/hello_have_a_nice_day_1.jpg", UriKind.Relative); flipTile.WideBackContent = "A smile is a curve that sets everything straight :)"; flipTile.WideBackBackgroundImage = new Uri("/Assets/Degradation-Background.jpg", UriKind.Relative); //Update Live Tile tile.Update(flipTile); } // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); }
public static void UpdateROMTile(string romFileName) { var tiles = ShellTile.ActiveTiles; romFileName = romFileName.ToLower(); foreach (var tile in tiles) { int index = tile.NavigationUri.OriginalString.LastIndexOf('='); if (index < 0) { continue; } String romName = tile.NavigationUri.OriginalString.Substring(index + 1); if (romName.ToLower().Equals(romFileName)) { ROMDatabase db = ROMDatabase.Current; ROMDBEntry entry = db.GetROM(romFileName); if (entry == null) { break; } FlipTileData data = CreateFlipTileData(entry); tile.Update(data); break; } } }
public void SFlipTileTemplate() { Profile profil = JsonConvert.DeserializeObject <Profile>(iso.Read("profile.json")); //ShellTile oTile = ShellTile.ActiveTiles.First(); ShellTile oTile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("flip".ToString())); if (oTile != null && oTile.NavigationUri.ToString().Contains("flip")) { FlipTileData oFliptile = new FlipTileData(); oFliptile.Title = "Old Gaming Quiz"; oFliptile.Count = profil.SolvedCount; oFliptile.BackTitle = profil.SolvedCount.ToString() + " ScreenShot Solved"; //oFliptile.BackContent = (30 - profil.solvedQuestion).ToString() + " Surah remaining"; oFliptile.BackContent = profil.SolvedCount.ToString() + " ScreenShot Solved"; oFliptile.WideBackContent = profil.SolvedCount.ToString() + " ScreenShot Solved"; oFliptile.SmallBackgroundImage = new Uri("/Assets/Tiles/159.png", UriKind.Relative); oFliptile.BackgroundImage = new Uri("/Assets/Tiles/336.png", UriKind.Relative); oFliptile.WideBackgroundImage = new Uri("/Assets/Tiles/691.png", UriKind.Relative); oFliptile.BackBackgroundImage = new Uri("/Assets/Tiles/336Back.png", UriKind.Relative); oFliptile.WideBackBackgroundImage = new Uri("/Assets/Tiles/691Back.png", UriKind.Relative); oTile.Update(oFliptile); } else { //once it is created flip tile MessageBox.Show("Tile Successfully Created"); Uri tileUri = new Uri("/MainPage.xaml?tile=flip", UriKind.Relative); ShellTileData tileData = this.CreateFlipTileData(); ShellTile.Create(tileUri, tileData, true); } }
/// <summary> /// Creates tile data /// </summary> private FlipTileData CreateTileData(Options options) { FlipTileData tile = new FlipTileData(); // Badge sollte nur gelöscht werden, wenn expliziet eine `0` angegeben wurde if (options.Badge != 0) { tile.Count = options.Badge; } tile.BackTitle = options.Title; tile.BackContent = options.ShortMessage; tile.WideBackContent = options.Message; if (!String.IsNullOrEmpty(options.SmallImage)) { tile.SmallBackgroundImage = new Uri(options.SmallImage, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.Image)) { tile.BackgroundImage = new Uri(options.Image, UriKind.RelativeOrAbsolute); } if (!String.IsNullOrEmpty(options.WideImage)) { tile.WideBackgroundImage = new Uri(options.WideImage, UriKind.RelativeOrAbsolute); } return(tile); }
public void UpdateLiveTileNotification(Item item) { #if NETFX_CORE var notification = GetPrimaryTileNotification(item); UpdatePrimaryTile(notification); #endif #if WINDOWS_PHONE try { ShellTile appTile = ShellTile.ActiveTiles.First(); var tileData = new FlipTileData() { //BackContent = item.Title, BackTitle = item.Title, //Title = item.Title, //WideBackContent = item.Title }; if (item.Image.Length > 0) { tileData.BackBackgroundImage = new Uri(item.Image); tileData.SmallBackgroundImage = new Uri(item.Image); tileData.WideBackBackgroundImage = new Uri(item.Image); } appTile.Update(tileData); } catch { }; #endif }
/// <summary> /// Agent that runs a scheduled task /// </summary> /// <param name="task"> /// The invoked task /// </param> /// <remarks> /// This method is called when a periodic or resource intensive task is invoked /// </remarks> protected override void OnInvoke(ScheduledTask task) { if (task is PeriodicTask) { var str = Application.GetResourceStream(new Uri("json.json", UriKind.Relative)); StreamReader streamReader = new StreamReader(str.Stream); string myString = streamReader.ReadToEnd(); var results = JsonConvert.DeserializeObject <Results>(myString); List <Word> allWords = results.results; Random random = new Random(); Word word = allWords[random.Next(0, (allWords.Count - 1))]; //Word word = allWords[(allWords.Count - 1)]; IEnumerable <ShellTile> PinnedTile = ShellTile.ActiveTiles; foreach (var item in PinnedTile) { FlipTileData UpdatedTileData = new FlipTileData { Title = "Słownik Śląski", BackTitle = "Słówko dnia", BackContent = word.silesian + "-\n" + word.polish, WideBackContent = word.silesian + "-\n" + word.polish }; item.Update(UpdatedTileData); } } NotifyComplete(); }
private static void ResetLiveTile() { var appSettings = IsolatedStorageSettings.ApplicationSettings; var enabled = appSettings.Contains("LiveTileToggleSwitchSetting") && (bool)appSettings["LiveTileToggleSwitchSetting"]; if (!enabled) { return; } var oTile = ShellTile.ActiveTiles.First(); if (oTile == null) { return; } var oFliptile = new FlipTileData { Count = 0, BackTitle = String.Empty, BackContent = String.Empty, WideBackContent = String.Empty, BackBackgroundImage = null, WideBackBackgroundImage = null, }; oTile.Update(oFliptile); }
public void UpdateLiveTileNotification(Item item) { #if NETFX_CORE var notification = GetPrimaryTileNotification(item); UpdatePrimaryTile(notification); #endif #if WINDOWS_PHONE try { ShellTile appTile = ShellTile.ActiveTiles.First(); var tileData = new FlipTileData() { //BackContent = item.Title, BackTitle = item.Title, //Title = item.Title, //WideBackContent = item.Title }; if (item.Image.Length > 0) { tileData.BackBackgroundImage = new Uri(item.Image); tileData.SmallBackgroundImage = new Uri(item.Image); tileData.WideBackBackgroundImage = new Uri(item.Image); } appTile.Update(tileData); } catch { }; #endif }
private void btnFlip_Click(object sender, RoutedEventArgs e) { try { if (checkTile("flipTile") == null) { FlipTileData flipTileData = new FlipTileData() { Title = "Sai Gon Xua", Count = DateTime.Now.Second, BackTitle = "Sai Gon Nay", BackgroundImage = new Uri("Images/h1.png", UriKind.Relative), BackBackgroundImage = new Uri("Images/h2.png", UriKind.Relative) }; ShellTile.Create(new Uri("/MainPage.xaml?flipTile", UriKind.RelativeOrAbsolute), flipTileData, true); } else { //MessageBox.Show("FlipTile Existing!"); toastMessage("FlipTile Existing"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ShellTile iconicTile = ShellTile.ActiveTiles.FirstOrDefault(); if (iconicTile != null) { var tileData = new FlipTileData { Title = "FoulPlay", Count = 0 }; iconicTile.Update(tileData); } string authCode; /* * If we're coming from IE with our Auth Code, parse it out and get the Access Token. * Else check if we already have it. * */ if (NavigationContext.QueryString.TryGetValue("authCode", out authCode)) { App.UserAccountEntity = new UserAccountEntity(); var authentication = new AuthenticationManager(); await authentication.RequestAccessToken(authCode); LoginTest(); } else { LoginTest(); } //var code = NavigationContext.QueryString["authCode"]; }
//tile updating private void PinTile() { try { ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("Flip".ToString())); TileToFind.Delete(); FlipTileData tileData = new FlipTileData { BackgroundImage = new Uri("Icons/runNew.png", UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri("Icons/wideRun.png", UriKind.RelativeOrAbsolute) }; ShellTile.Create(new Uri("/MainPage.xaml?Flip", UriKind.Relative), tileData, true); } catch (Exception e) { FlipTileData tileData = new FlipTileData { BackgroundImage = new Uri("Icons/runNew.png", UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri("Icons/wideRun.png", UriKind.RelativeOrAbsolute) }; ShellTile.Create(new Uri("/MainPage.xaml?Flip", UriKind.Relative), tileData, true); } }
private void btnPinSecondary_Click(object sender, EventArgs e) { Uri smallimage = new Uri("Images/FlipCycleSmall.png", UriKind.Relative); Uri mediumimage = new Uri("Images/FlipCycleMedium.png", UriKind.Relative); //Uri[] mediumImages = new Uri[1]; //mediumImages[0] = mediumimage; //CycleTileData NewTileData = new CycleTileData //{ // SmallBackgroundImage = smallimage, // CycleImages = mediumImages, // Title = SelectedCinema.Name //}; FlipTileData NewTileData = new FlipTileData() { SmallBackgroundImage = smallimage, BackgroundImage = mediumimage, Title = SelectedCinema.Name }; // Create the Tile and pin it to Start. This will cause a navigation to Start and a deactivation of our application. ShellTile.Create(new Uri(String.Format("/CinemaDetails.xaml?CinemaID={0}&Region={1}", SelectedCinema.ID, Config.Region.ToString("d")), UriKind.Relative), NewTileData, false); }
private static void UpdateFlipTileWithImage(String message, int count) { if (!App.Settings.LiveTileToggleSwitchSetting) { return; } var oTile = ShellTile.ActiveTiles.First(); if (oTile == null) { return; } var oFliptile = new FlipTileData { Count = count, BackContent = message, WideBackContent = message, BackBackgroundImage = new Uri("isostore:/Shared/ShellContent/tile.jpg", UriKind.Absolute), WideBackBackgroundImage = new Uri("isostore:/Shared/ShellContent/tile.jpg", UriKind.Absolute) }; oTile.Update(oFliptile); }
private void CreateTiles() { IsolatedStorageSettings applicationSettings = IsolatedStorageSettings.get_ApplicationSettings(); try { if (Enumerable.FirstOrDefault <ShellTile>(ShellTile.get_ActiveTiles()) != null) { FlipTileData flipTileDatum = new FlipTileData(); flipTileDatum.set_BackgroundImage(new Uri("/Assets/Tiles/iconapp21.png", 2)); flipTileDatum.set_Title("Tivi Việt Free"); flipTileDatum.set_WideBackgroundImage(new Uri("/Assets/Tiles/logofull.png", 2)); ShellTile.Create(new Uri("/MainPage.xaml", 2), flipTileDatum, false); if (applicationSettings.Contains("Zipcodes")) { applicationSettings.set_Item("Zipcodes", "titles"); } else { applicationSettings.Add("Zipcodes", "titles"); } applicationSettings.Save(); } } catch (Exception exception) { } }
/// <summary> /// Updates the FlipTile with appropriate data from a collection of quakes. /// </summary> /// <param name="quakes"></param> public void UpdateFlipTile(IEnumerable<Earthquake> quakes) { // Following code found here: http://stackoverflow.com/questions/8027812/can-i-update-a-live-tile-in-mango-using-local-data FlipTileData newTileData; TimeSpan oneDay = new TimeSpan(24, 0, 0); DateTime yesterday = DateTime.Now.Subtract(oneDay); List<Earthquake> latestQuakes = quakes.Where(q => (DateTime.Compare(q.Date, yesterday) > 0)).ToList(); if (latestQuakes.Count > 0) { Earthquake latestQuake = latestQuakes.First(); newTileData = new FlipTileData { Title = String.Format(AppResources.LiveTileTitleFormat, latestQuakes.Count), BackTitle = String.Format(AppResources.LiveTileTitleFormat, latestQuakes.Count), BackContent = String.Format(AppResources.LiveTileBackContentFormat, latestQuake.FormattedMagnitude, latestQuake.FormattedDepth), WideBackContent = String.Format(AppResources.LiveTileWideBackContentFormat, latestQuake.FormattedMagnitude, latestQuake.FormattedDepth, latestQuake.RelativeLocation), }; } else { newTileData = new FlipTileData { Title = DefaultTileTitle, BackTitle = string.Empty, BackContent = AppResources.LiveTileBackContentNoQuakes, WideBackContent = AppResources.LiveTileBackContentNoQuakes, }; } UpdateTile(newTileData); }
// Set all the properties of the Application Tile. void SetApplicationTile( string strBackContent ) { // Application Tile is always the first Tile, even if it is not pinned to Start. ShellTile TileToFind = ShellTile.ActiveTiles.First(); // Application should always be found if ( null != TileToFind ) { // set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. FlipTileData NewTileData = new FlipTileData() { Title = AppResources.AppTitle, BackTitle = AppResources.AppTitle, SmallBackgroundImage = new Uri("/Content/SmallBlankTileImage159x159.png", UriKind.Relative), BackgroundImage = new Uri("/Content/MediumBlankTileImage336x336.png", UriKind.Relative), BackBackgroundImage = new Uri("/Content/MediumBlankBackTileImage336x336.png", UriKind.Relative), WideBackgroundImage = new Uri("/Content/WideBackBackgroundTileIcon691x336WithGlow.png", UriKind.Relative), WideBackBackgroundImage = new Uri("/Content/WideBlankBackTileIcon691x336.png", UriKind.Relative), }; // Update the Application Tile TileToFind.Update(NewTileData); } } // SetApplicationTile()
public static void Reset() { FlipTileData flipTileData = new FlipTileData { SmallBackgroundImage = new Uri("/Assets/Tiles/SmallTile.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/MediumTile.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/WideTile.png", UriKind.Relative), Title = AppInfo.Name, Count = 0, }; try { ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault(); if (tile != null) { tile.Update(flipTileData); Debug.WriteLine("> Reset primární dlaždice dokončena."); } } catch { Debug.WriteLine("Chyba při resetu primární dlaždice."); } }
/// <summary> /// Updates application live tile /// </summary> public void updateAppTile(string options) { LiveTilesOptions liveTileOptions; try { liveTileOptions = JsonHelper.Deserialize <LiveTilesOptions>(options); } catch (Exception) { DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); return; } try { ShellTile appTile = ShellTile.ActiveTiles.First(); if (appTile != null) { FlipTileData flipTile = CreateFlipTileDate(liveTileOptions); appTile.Update(flipTile); DispatchCommandResult(new PluginResult(PluginResult.Status.OK)); } else { DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Can't get application tile")); } } catch (Exception) { DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error updating application tile")); } }
public static void UpdatePrimaryTile(int count) { // only if I can use WP8 tiles - update the first tile if (Utils.CanUseLiveTiles) { var tileId = ShellTile.ActiveTiles.FirstOrDefault(); if (tileId != null) { var tileData = new FlipTileData(); tileData.Title = AppResources.ApplicationTitle; tileData.BackgroundImage = new Uri("/Images/tile.medium.png", UriKind.Relative); tileData.WideBackgroundImage = new Uri("/Images/tile.wide.png", UriKind.Relative); if (SettingsHelper.StreakCounterEnabled) { tileData.Count = count; } else { tileData.Count = 0; } #if DEBUG Debug.WriteLine("Activating live tile: " + Mangopollo.Utils.CanUseLiveTiles); #endif tileId.Update(tileData); } } }
public void UpdateUi(BandwidthResults bandwidthResults, bool fromNetwork) { foreach (var control in new Dictionary<BandwidthMeter, String> { { PolicyDown, bandwidthResults.PolicyReceived }, { PolicyUp, bandwidthResults.PolicySent }, { ActualDown, bandwidthResults.ActualReceived }, { ActualUp, bandwidthResults.ActualSent } }) { control.Key.UpdateBorder(GetBandwidthNumberFromString(control.Value), PolicyDown.ActualHeight); control.Key.UsageTextBlock.Text = control.Value; } var tileData = new FlipTileData() { BackContent = GetBandwidthStringForTile(bandwidthResults), Title = "Bandwidth Monitor" }; var primaryTile = ShellTile.ActiveTiles.First(); primaryTile.Update(tileData); if (fromNetwork) SystemTray.ProgressIndicator.IsVisible = false; }
protected async override void OnNavigatedTo(NavigationEventArgs e) { List<Balance> history = await App.MobileService.GetTable<Balance>().ToListAsync(); double generalPrice = history.Sum(h => Convert.ToDouble(h.Price)); thisApp.AllCosts = generalPrice.ToString() + " USD"; thisApp.AllBalances = history.Count; FlipTileData newTile = new FlipTileData() { Title = "Home Budget", Count = thisApp.AllBalances, BackgroundImage = new Uri("/Assets/Tiles/Wallet-BackgroundImage.png", UriKind.Relative), SmallBackgroundImage = new Uri("/Assets/Tiles/Wallet-SmallBackgroundImage.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/Wallet-WideBackgroundImage.png", UriKind.Relative), BackTitle = "Home Budget", BackContent = thisApp.AllCosts, WideBackContent = "General balance: " + thisApp.AllCosts, BackBackgroundImage = new Uri("/Assets/Tiles/Blue-BackBackgroundImage.png", UriKind.Relative), WideBackBackgroundImage = new Uri("/Assets/Tiles/Blue-WideBackBackogrundImage.png", UriKind.Relative) }; primaryTile.Update(newTile); base.OnNavigatedTo(e); }
private void pin_Click(object sender, RoutedEventArgs e) { try { ForumSubf drv = (sender as MenuItem).DataContext as ForumSubf; if (drv != null) { FlipTileData ftd = new FlipTileData() { Title = drv.fName, SmallBackgroundImage = new Uri("/images/forum_background.png", UriKind.Relative), BackgroundImage = new Uri("/images/forum_background.png", UriKind.Relative), WideBackgroundImage = new Uri("/images/forum_background_large.png", UriKind.Relative), }; /*StandardTileData std = new StandardTileData(); * std.Title = drv.fName; * std.BackgroundImage = new Uri("/images/forum_background.png", UriKind.Relative);*/ //ShellTile.Create(new Uri("/ForumSub.xaml?forum_id=" + drv.fID, UriKind.Relative), std); ShellTile.Create(new Uri("/MainPage.xaml?forum_id=" + drv.fID, UriKind.Relative), ftd, true); } } catch (Exception ex) { //BugSenseHandler.Instance.SendExceptionAsync(ex); //hicbir sey yapma } }
public static FlipTileData CreateTile(TaskModel task) { string smallFileName = string.Format("{0}{1}_{2}", TileImageDirectory, task.Uid, SmallTileFileName); string mediumFileName = string.Format("{0}{1}_{2}", TileImageDirectory, task.Uid, MediumTileFileName); string wideFileName = string.Format("{0}{1}_{2}", TileImageDirectory, task.Uid, WideTileFileName); // Vytvoření obrázků dlaždic var sw = Stopwatch.StartNew(); new SmallTaskTile(task).SaveToPng(smallFileName); new MediumTaskTile(task).SaveToPng(mediumFileName); new WideTaskTile(task).SaveToPng(wideFileName); sw.Stop(); Debug.WriteLine("> CREATED TILE FOR '{0}' (in {1:0.000} seconds)", task.Title, sw.ElapsedMilliseconds / 1000.0); FlipTileData flipTileData = new FlipTileData { SmallBackgroundImage = new Uri("isostore:" + smallFileName, UriKind.Absolute), BackgroundImage = new Uri("isostore:" + mediumFileName, UriKind.Absolute), WideBackgroundImage = new Uri("isostore:" + wideFileName, UriKind.Absolute), Title = "", Count = 0, }; return(flipTileData); }
/// <summary> /// Agent that runs a scheduled task /// </summary> /// <param name="task"> /// The invoked task /// </param> /// <remarks> /// This method is called when a periodic or resource intensive task is invoked /// </remarks> protected async override void OnInvoke(ScheduledTask task) { if(NetworkInterface.GetIsNetworkAvailable()) { try { var comic = await XkcdInterface.GetCurrentComic(); var tileData = new FlipTileData { BackgroundImage = new Uri(comic.ImageUri), WideBackgroundImage = new Uri(comic.ImageUri) }; ShellTile tile = ShellTile.ActiveTiles.First(); if(tile != null) { tile.Update(tileData); } //var settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings; //if(!(bool)settings["IsAppRunning"]) { // var list = (ObservableCollection<Comic>)settings["ComicList"]; // if(list[0].Number != comic.Number) { // list.Insert(0, comic); // } //} } catch(WebException) { } catch(InvalidOperationException) { } } //NotifyComplete(); }
void tileMenuItem_Click(object sender, EventArgs e) { try { if (StorageController.doesFileExist(App.ShowViewModel.Tvdb + "background.jpg")) { ImageController.copyImageToShellContent(App.ShowViewModel.Tvdb + "background.jpg", App.ShowViewModel.Tvdb); FlipTileData NewTileData = new FlipTileData { BackgroundImage = new Uri("isostore:/Shared/ShellContent/wptraktbg" + App.ShowViewModel.Tvdb + ".jpg", UriKind.Absolute), WideBackgroundImage = new Uri("isostore:/Shared/ShellContent/wptraktbg" + App.ShowViewModel.Tvdb + ".jpg", UriKind.Absolute), Title = App.ShowViewModel.Name, }; if (!StorageController.doesFileExist("/Shared/ShellContent/wptraktbg" + App.ShowViewModel.Tvdb + ".jpg")) { NewTileData.BackgroundImage = new Uri("appdata:background.png");; } ShellTile.Create( new Uri( "/ViewShow.xaml?id=" + App.ShowViewModel.Tvdb, UriKind.Relative), NewTileData, true); } } catch (InvalidOperationException) { } }
private static void SaveTilePart(string filename, Tile tile) { var newTile = new FlipTileData { Count = 0, BackContent = string.Empty, Title = string.Empty, BackTitle = string.Empty }; switch (tile) { case Tile.Front: newTile.BackgroundImage = new Uri(filename, UriKind.Absolute); break; case Tile.Back: newTile.BackBackgroundImage = new Uri(filename, UriKind.Absolute); break; case Tile.Small: newTile.SmallBackgroundImage = new Uri(filename, UriKind.Absolute); break; } var firstOrDefault = ShellTile.ActiveTiles.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.Update(newTile); } }
private void updateLiveTile(int msgCount) { /* Update title contents */ var mainTile = ShellTile.ActiveTiles.FirstOrDefault(); if (null != mainTile) { FlipTileData tileData = new FlipTileData() { Count = msgCount }; switch (msgCount) { case 0: tileData.BackContent = string.Empty; break; case 1: tileData.BackContent = "You have " + msgCount + " post you have not read!"; break; default: tileData.BackContent = "You have " + msgCount + " posts you have not read!"; break; } mainTile.Update(tileData); } }
public MainPage() { InitializeComponent(); Messenger.Default.Register<Sms>(this, ShowSms); List<Sms> load = SmsDb.LoadData(); ListReminders.ItemsSource = load; int count = load.Count; Sms sms = load.FirstOrDefault(); if (sms == null) return; ShellTile tuileParDefaut = ShellTile.ActiveTiles.First(); if (tuileParDefaut != null) { var flipTileData = new FlipTileData { Title = "SmsReminders", Count = count, BackTitle = "Next reminder", BackContent = sms.Number + "\r\nat " + sms.Date, }; tuileParDefaut.Update(flipTileData); } }
/// <summary> /// Sets application live tile /// </summary> public void add(string jsonArgs) { string[] args = JsonHelper.Deserialize <string[]>(jsonArgs); Options options = JsonHelper.Deserialize <Options>(args[0]); // Application Tile is always the first Tile, even if it is not pinned to Start. ShellTile AppTile = ShellTile.ActiveTiles.First(); if (AppTile != null) { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. FlipTileData TileData = CreateTileData(options); // Update the Application Tile AppTile.Update(TileData); if (!string.IsNullOrEmpty(options.Foreground)) { string arguments = String.Format("{0}({1})", options.Foreground, options.ID); DispatchCommandResult(new PluginResult(PluginResult.Status.OK, arguments)); } } DispatchCommandResult(); }
// Constructor public MainPage() { InitializeComponent(); // Set the data context of the listbox control to the sample data DataContext = App.ViewModel; //Uri tileUri = new Uri("/MainPage.xaml?tile=flip", UriKind.Relative); //ShellTileData tileData = this.CreateFlipTileData(); //ShellTile.Create(tileUri, tileData, true); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); var tileId = ShellTile.ActiveTiles.FirstOrDefault(); if (tileId != null) { var tileData = new FlipTileData(); tileData.BackBackgroundImage = new Uri(@" http://mywebsite/NYTraffic/Icon"); tileData.WideBackBackgroundImage = new Uri(@" http://mywebsite/NYTraffic/IconLarge"); var trafficTileSchedule = new ShellTileSchedule(tileId, tileData); trafficTileSchedule.Recurrence = UpdateRecurrence.Interval; trafficTileSchedule.Interval = UpdateInterval.EveryHour; trafficTileSchedule.Start(); } }
/// <summary> /// Clears the application live tile /// </summary> public void cancelAll(string jsonArgs) { // Application Tile is always the first Tile, even if it is not pinned to Start. ShellTile AppTile = ShellTile.ActiveTiles.First(); if (AppTile != null) { // Set the properties to update for the Application Tile // Empty strings for the text values and URIs will result in the property being cleared. FlipTileData TileData = new FlipTileData { Count = 0, BackTitle = "", BackContent = "", WideBackContent = "", SmallBackgroundImage = new Uri("appdata:Background.png"), BackgroundImage = new Uri("appdata:Background.png"), WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), }; // Update the Application Tile AppTile.Update(TileData); } DispatchCommandResult(); }
public void StopFlipTile(TileInfo tileInfo) { string xmlFlipTileData = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xmlFlipTileData += "<wp:Notification xmlns:wp=\"WPNotification\" Version=\"2.0\">"; xmlFlipTileData += "<wp:Tile Id=\"1\" Template=\"FlipTile\">"; xmlFlipTileData += "<wp:Count>" + tileInfo.Count + "</wp:Count>"; xmlFlipTileData += "<wp:Title>" + tileInfo.Title + "</wp:Title>"; if (!string.IsNullOrEmpty(tileInfo.BackgroundImagePath)) xmlFlipTileData += "<wp:BackgroundImage IsRelative=\"true\">" + tileInfo.BackgroundImagePath + "</wp:BackgroundImage>"; xmlFlipTileData += "<wp:BackTitle Action=\"Clear\"> </wp:BackTitle>"; xmlFlipTileData += "<wp:BackContent Action=\"Clear\"></wp:BackContent>"; xmlFlipTileData += "<wp:WideBackContent Action=\"Clear\"></wp:WideBackContent>"; xmlFlipTileData += "<wp:BackBackgroundImage IsRelative=\"true\" Action=\"Clear\"></wp:BackBackgroundImage>"; xmlFlipTileData += "<wp:WideBackBackgroundImage IsRelative=\"true\" Action=\"Clear\"></wp:WideBackBackgroundImage>"; xmlFlipTileData += "</wp:Tile>"; xmlFlipTileData += "</wp:Notification>"; var tileData = new FlipTileData(xmlFlipTileData); ShellTile tileToFind = ShellTile.ActiveTiles.FirstOrDefault(); if (tileToFind != null) tileToFind.Update(tileData); }
private void ButtonBase_OnClick_Flip(object sender, RoutedEventArgs e) { var tile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("flip")); var flipTileData = new FlipTileData { Title = "Title", Count = 56, BackTitle = "BackTitle", BackContent = "BackContent", WideBackContent = "WideBackContent", SmallBackgroundImage = new Uri(@"Assets/Tiles/Flip/159x159.png", UriKind.Relative), BackgroundImage = new Uri(@"Assets/Tiles/Flip/336x336.png", UriKind.Relative), WideBackBackgroundImage = new Uri(@"Assets/Tiles/Flip/691x336.png", UriKind.Relative), BackBackgroundImage = new Uri(@"Assets/Tiles/Flip/A336.png", UriKind.Relative), WideBackgroundImage = new Uri(@"Assets/Tiles/Flip/A691.png", UriKind.Relative) }; if (tile != null) { tile.Update(flipTileData); } else { var shellTileData = new StandardTileData { Title = "Title", Count = 56, BackTitle = "BackTitle", BackContent = "BackContent", BackgroundImage = new Uri(@"Assets/Tiles/Flip/336x336.png", UriKind.Relative) }; ShellTile.Create(new Uri("/Tiles.xaml?id=flip", UriKind.Relative), shellTileData); } }
public static void CreateFlipTile(string uri, string contains, string smallBackgroundImage, string backgroundImage, string widebackgroundImage) { ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains(contains)); if (tile != null && tile.NavigationUri.ToString().Contains(contains)) { var iconicTileData = new FlipTileData { SmallBackgroundImage = new Uri(smallBackgroundImage, UriKind.RelativeOrAbsolute), BackgroundImage = new Uri(backgroundImage, UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri(widebackgroundImage, UriKind.RelativeOrAbsolute), Title = AppResources.TextReboot }; tile.Update(iconicTileData); Toast.Title = AppResources.TextNotice; Toast.Message = AppResources.TextSuccessfully; Toast.Show(); } else { var tileUri = new Uri(uri + contains, UriKind.RelativeOrAbsolute); var tileData = new FlipTileData { SmallBackgroundImage = new Uri(smallBackgroundImage, UriKind.RelativeOrAbsolute), BackgroundImage = new Uri(backgroundImage, UriKind.RelativeOrAbsolute), WideBackgroundImage = new Uri(widebackgroundImage, UriKind.RelativeOrAbsolute), Title = AppResources.TextReboot }; ShellTile.Create(tileUri, tileData, true); } }
public static void UpdatePrimaryTileBadge(int count) { var primaryTileData = new FlipTileData(); primaryTileData.Count = count; var primaryTile = ShellTile.ActiveTiles.First(); primaryTile.Update(primaryTileData); }
private void bt_Updated(object sender, RoutedEventArgs e) { Uri mp = new Uri("/MainPage.xaml?", UriKind.Relative);// Navigate to the page for modifying Application Tile properties. ShellTile PinnedTile = ShellTile.ActiveTiles.First(); FlipTileData TileData = new FlipTileData { Title = "Flip Tile", Count = 10, SmallBackgroundImage = new Uri("/Assets/Tiles/Image1.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/Image2.png", UriKind.Relative), BackBackgroundImage = new Uri("/Assets/Tiles/Image3.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/LargeImage1.png", UriKind.Relative), WideBackBackgroundImage = new Uri("/Assets/Tiles/LargeImage2.png", UriKind.Relative), BackTitle = "Flip Tile", // title when it flip BackContent = "Flip Tile", // content when it flip WideBackContent = "Seminar" // content of WideBackground }; PinnedTile.Update(TileData); // ShellTile.Create(mp, TileData, true); }
private static FlipTileData CreateFlipTileData(ROMDBEntry re) { FlipTileData data = new FlipTileData(); data.Title = re.DisplayName; if (re.SnapshotURI.Equals(FileHandler.DEFAULT_SNAPSHOT) || re.SnapshotURI.Equals(FileHandler.DEFAULT_SNAPSHOT_ALT)) { #if !GBC data.SmallBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileSmall.png", UriKind.Relative); data.BackgroundImage = new Uri("Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative); data.WideBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative); #else data.SmallBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileSmallGBC.png", UriKind.Relative); data.BackgroundImage = new Uri("Assets/Tiles/FlipCycleTileMediumGBC.png", UriKind.Relative); data.WideBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileLargeGBC.png", UriKind.Relative); #endif } else { data.SmallBackgroundImage = new Uri("isostore:/" + re.SnapshotURI, UriKind.Absolute); data.BackgroundImage = new Uri("isostore:/" + re.SnapshotURI, UriKind.Absolute); data.WideBackgroundImage = new Uri("isostore:/" + re.SnapshotURI, UriKind.Absolute); } return(data); }
private void Pin_Click_1(object sender, EventArgs e) { try { string tileparameter = string.Format("{0:f2} km", _kilometres); FlipTileData flipTileData = new FlipTileData(); flipTileData.Title = "Tracker"; flipTileData.BackTitle = "Tracker"; flipTileData.BackgroundImage = new Uri("/Images/Tracker/Medium.jpg", UriKind.Relative); flipTileData.SmallBackgroundImage = new Uri("/Images/Tracker/Small.jpg", UriKind.Relative); flipTileData.WideBackgroundImage = new Uri("/Images/Tracker/Large.jpg", UriKind.Relative); flipTileData.WideBackBackgroundImage = null; flipTileData.BackContent = string.Format("{0:f2} km", _kilometres); flipTileData.WideBackContent = string.Format("{0:f2} km", _kilometres); ShellTile tiletopin = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains(tileparameter)); if (tiletopin == null) { ShellTile.Create(new Uri("/Views/Tracker.xaml?" + tileparameter, UriKind.Relative), flipTileData, true); } else { MessageBox.Show("Already Pinned.", "Information", MessageBoxButton.OK); } } catch (Exception ex) { MessageBox.Show("Already Pinned.", "Information", MessageBoxButton.OK); } }
public static void ResetTile() { var flipTile = new FlipTileData(); flipTile.BackTitle = ""; flipTile.BackContent = ""; flipTile.BackBackgroundImage = null; InternalUpdateTile(flipTile); }
private void UpdateLockScreenCount_Click(object sender, RoutedEventArgs e) { var tile = ShellTile.ActiveTiles.First(); var data = new FlipTileData() { Count = new Random(DateTime.Now.Millisecond).Next(100), }; tile.Update(data); }
// TODO: figure out how to update the tile every minute... public static void UpdatePrimaryTile(string content, string image) { FlipTileData primaryTileData = new FlipTileData(); primaryTileData.BackContent = content; primaryTileData.BackgroundImage = new Uri(image, UriKind.Absolute); ShellTile primaryTile = ShellTile.ActiveTiles.First(); primaryTile.Update(primaryTileData); }
private void UpdateLockScreenText_Click(object sender, RoutedEventArgs e) { var tile = ShellTile.ActiveTiles.First(); var data = new FlipTileData() { BackContent = "back content", WideBackContent = "wide back content" }; tile.Update(data); }
public void UpdateTiles() { GetMeData((App.Current as App).todos_Today, todayTileTextList); TileData frontTileData = new TileData() { TextTitle = "即将", TextLine1 = todayTileTextList.ElementAt(0), TextLine2 = todayTileTextList.ElementAt(1), TextLine3 = todayTileTextList.ElementAt(2) }; TileBackData backTileData = new TileBackData() { TextLine1 = todayTileTextList.ElementAt(3), TextLine2 = todayTileTextList.ElementAt(4), TextLine3 = todayTileTextList.ElementAt(5) }; CreateMediumTiles(frontTileData, backTileData); CreateLargeTiles(frontTileData, backTileData); ShellTile tile = ShellTile.ActiveTiles.First(); if ((App.Current as App).flip) { var data = new FlipTileData { Count = 0, Title = "I.DO", BackTitle = "I.DO", BackgroundImage = new Uri("isostore:" + mediumFrontFilename, UriKind.Absolute), WideBackgroundImage = new Uri("isostore:" + largeFrontFilename, UriKind.Absolute), BackBackgroundImage = new Uri("isostore:" + mediumBackFilename, UriKind.Absolute), WideBackBackgroundImage = new Uri("isostore:" + largeBackFilename, UriKind.Absolute) }; tile.Update(data); } else { var data = new FlipTileData { Count = 0, BackTitle = String.Empty, BackContent = String.Empty, BackgroundImage = new Uri("isostore:" + mediumFrontFilename, UriKind.Absolute), WideBackgroundImage = new Uri("isostore:" + largeFrontFilename, UriKind.Absolute), BackBackgroundImage = new Uri("aa", UriKind.Relative), WideBackBackgroundImage = new Uri("aa", UriKind.Relative) }; tile.Update(data); } }
private void btUpdated_Click(object sender, RoutedEventArgs e) { /* Uri mp = new Uri("/MainPage.xaml?", UriKind.Relative);// Navigate to the page for modifying Application Tile properties. ShellTile PinnedTile = ShellTile.ActiveTiles.First(); FlipTileData TileData = new FlipTileData { Title = "Flip Tile", Count = 10, SmallBackgroundImage = new Uri("/Assets/Tiles/Image1.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/Image2.png", UriKind.Relative), BackBackgroundImage = new Uri("/Assets/Tiles/Image3.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/LargeImage1.png", UriKind.Relative), WideBackBackgroundImage = new Uri("/Assets/Tiles/LargeImage2.png", UriKind.Relative), BackTitle = "Flip Tile", // title when it flip BackContent = "Flip Tile", // content when it flip WideBackContent = "Seminar" // content of WideBackground }; PinnedTile.Update(TileData); ShellTile.Create(mp, TileData, true); */ FlipTileData flipTile = new FlipTileData { Title = "Flip Tile", BackTitle = "SE114.G13", // title when it flip BackContent = "KTPM2013", // content when it flip WideBackContent = "Nhập môn phần mềm và hệ thống nhúng", // content of WideBackground Count = 8, SmallBackgroundImage = new Uri("/Assets/Tiles/Image1.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/Image2.png", UriKind.Relative), BackBackgroundImage = new Uri("/Assets/Tiles/Image3.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/LargeImage1.png", UriKind.Relative), WideBackBackgroundImage = new Uri("/Assets/Tiles/LargeImage2.png", UriKind.Relative) }; string uri = string.Concat("/MainPage.xaml?", "id=flip"); ShellTile shellTile = checkTile(uri); if (shellTile == null) { ShellTile.Create(new Uri(uri, UriKind.Relative), flipTile, true); } else { shellTile.Update(flipTile); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { var tile = ShellTile.ActiveTiles.First(); var data = new FlipTileData { Count = 0, Title = "title", BackContent = "BackContent" }; tile.Update(data); }
/// <summary> /// Clears the FlipTile of all back content, effectively rendering it a /// static/non-live tile. /// </summary> public void ClearFlipTile() { var newTileData = new FlipTileData { Title = DefaultTileTitle, BackTitle = string.Empty, BackContent = string.Empty, WideBackContent = string.Empty, }; UpdateTile(newTileData); }
private void UpdateTile(FlipTileData tileData) { // Application Tile is always the first Tile, even if it is not pinned to Start ShellTile tileToFind = ShellTile.ActiveTiles.First(); // Application Tile should always be found if (tileToFind != null) { // update the Application Tile tileToFind.Update(tileData); } }
private void pinButton_Click(object sender, EventArgs e) { var tileData = new FlipTileData { SmallBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileSmall.png", UriKind.Relative), BackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative), WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), BackTitle = string.Format("Hello {0}!", helloMessage.Text), BackContent = "Windows Phone 8 in Action", WideBackContent = "Windows Phone 8 in Action. Written by Timothy Binkley-Jones, Massimo Perga and Micheal Sync", }; ShellTile.Create(BuildNavigationUri(helloMessage.Text), tileData, true); }
public static void SetInformation(int tileCount, string message) { var primaryTileToken = ShellTile.ActiveTiles.FirstOrDefault(); var flipTileData = new FlipTileData { Count = tileCount, WideBackContent = message }; if (primaryTileToken != null) { primaryTileToken.Update(flipTileData); } }
public void UpdateTile() { var tileData = new FlipTileData { Title = Title ?? "", Count = Count, BackTitle = BackTitle ?? "", BackContent = BackContent ?? "", BackgroundImage = new Uri(BackgroundImagePath ?? "", UriKind.Relative), BackBackgroundImage = new Uri(BackBackgroundImagePath ?? "", UriKind.Relative) }; // Actualiza el live tile con la plantilla ShellTile.ActiveTiles.FirstOrDefault().Update(tileData); }
private static StandardTileData GetSecondaryTileData(string cardName, string cardDescription) { var tileData = new FlipTileData { Title = cardName, BackTitle = cardName, BackContent = cardDescription, BackBackgroundImage = new Uri(BACKGROUND_IMAGE_PATH, UriKind.Relative), BackgroundImage = new Uri(BACKGROUND_IMAGE_PATH, UriKind.Relative), WideBackBackgroundImage = new Uri(BACKGROUND_WIDE_IMAGE_PATH, UriKind.Relative), WideBackgroundImage = new Uri(BACKGROUND_WIDE_IMAGE_PATH, UriKind.Relative), }; return tileData; }