コード例 #1
0
        private void RefreshBtn_Click(object sender, RoutedEventArgs e)
        {
            var    updator         = TileUpdateManager.CreateTileUpdaterForApplication();
            string TileTemplateXml = @"
                <tile branding='name'> 
                  <visual version='3'>
                    <binding template='TileMedium'>
                      <text>{0}</text>
                      <text hint-style='captionsubtle' hint-wrap='true'>{1}</text>
                    </binding>
                    <binding template='TileWide'>
                      <text>{0}</text>
                      <text hint-style='captionsubtle' hint-wrap='true'>{1}</text>
                    </binding>
                    <binding template='TileLarge'>
                      <text>{0}</text>
                      <text hint-style='captionsubtle' hint-wrap='true'>{1}</text>
                    </binding>
                  </visual>
                </tile>";
            var    item            = new TodoItemCollection().Collection.Last();
            var    doc             = new XmlDocument();
            var    xml             = string.Format(TileTemplateXml, item.Name, item.Detail);

            doc.LoadXml(WebUtility.HtmlDecode(xml), new XmlLoadSettings {
                ProhibitDtd              = false,
                ValidateOnParse          = false,
                ElementContentWhiteSpace = false,
                ResolveExternals         = false
            });
            updator.Update(new TileNotification(doc));
        }
コード例 #2
0
 public void SelectItem(TodoItem item)
 {
     if (this.VisualStateGroup.CurrentState == this.VisualStateMin0)
     {
         int index = new TodoItemCollection().Collection.IndexOf(item);
         this.Frame.Navigate(typeof(NewPage), index);
     }
     else
     {
         DetailView.Item          = item;
         this.DeleteBtn.IsEnabled = true;
         this.ShareBtn.IsEnabled  = true;
     }
 }