Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My understanding is that every app decides where to do this for itself. Normally, you'd do it whenever you're also updating your normal UI with the same data - e.g. if your app is an RSS reader, and you've just downloaded a new item to display, that's where you also update your tile by posting a notification. In the sample JavaScript app, this is done from event handlers for controls for the sake of convenience.</p> <p>As for the code to change the tile, it should be almost identical to JavaScript version, since in both cases you use <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br208661%28v=VS.85%29.aspx" rel="noreferrer">Windows.UI.Notifications namespace</a>. Following is a very simple C# app that updates the tile when you click the button. XAML:</p> <pre><code>&lt;UserControl x:Class="TileNotificationCS.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" d:DesignHeight="768" d:DesignWidth="1366"&gt; &lt;StackPanel x:Name="LayoutRoot" Background="#FF0C0C0C"&gt; &lt;TextBox x:Name="message"/&gt; &lt;Button x:Name="changeTile" Content="Change Tile" Click="changeTile_Click" /&gt; &lt;/StackPanel&gt; &lt;/UserControl&gt; </code></pre> <p>and code behind:</p> <pre><code>using System; using Windows.Data.Xml.Dom; using Windows.UI.Notifications; using Windows.UI.Xaml; namespace TileNotificationCS { partial class MainPage { TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); public MainPage() { InitializeComponent(); } private void changeTile_Click(object sender, RoutedEventArgs e) { XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText01); XmlElement textElement = (XmlElement)tileXml.GetElementsByTagName("text")[0]; textElement.AppendChild(tileXml.CreateTextNode(message.Text)); tileUpdater.Update(new TileNotification(tileXml)); } } } </code></pre> <p>Don't forget that you need a wide tile for text to show up - to get it, set some image for "Wide Logo" in Package.appxmanifest.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload