c# - Live Tile Update -


i have media application needs display track image , title on live tile. right have following code:-

private void setlivetile()     {         var livetile = @"<tile>                             <visual version=""1"">                               <binding template=""tilewidesmallimageandtext01"">                                 <text id=""1"">" + mediacontrol.artistname + " - " + mediacontrol.trackname + @"</text>                                 <image id=""1"" src=" + mediacontrol.albumart + @"""/>                               </binding>                               <binding template=""tilesquarepeekimageandtext02"">                                 <text id=""1"">" + mediacontrol.artistname + " - " + mediacontrol.trackname + @"</text>                                 <image id=""1"" src=" + mediacontrol.albumart + @"""/>                               </binding>                             </visual>                           </tile>";          xmldocument tilexml = new xmldocument();         tilexml.loadxml(livetile);          var tilenotification = new windows.ui.notifications.tilenotification(tilexml);         windows.ui.notifications.tileupdatemanager.createtileupdaterforapplication().update(tilenotification);     } 

it doesn't work, loadxml fails error code c00ce502.

i need update every 1 minute @ least, though awesome if update every 30 seconds. needs remove live tile , revert original tile upon closing of application.

for xml issue looks you're missing opening quote in src tags, try

 <image id=""1"" src=""" + mediacontrol.albumart + @"""/> 

as updating on minute or 30-second basis, take @ this sample on dev.windows.com.

clearing tile on termination tricky since you're not informed programmatically of cases app indeed terminated.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -