This is a migrated thread and some comments may be shown as answers.

remote image as VisualElement within backgroundagent

1 Answer 44 Views
LiveTileHelper
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stefano
Top achievements
Rank 1
Stefano asked on 05 Aug 2013, 02:40 PM
Hi,
I'm trying to add as VisualElement of he tile a user control that uses a remote hosted image, when creating or updating the tile from within the App it works great and I'm able to see the image, but when doing same from a backgroundAgent the image is not being set.

this is the code in the background agent:

Deployment.Current.Dispatcher.BeginInvoke(() =>

{

// set the tile

AvatarTile avatarTile = new AvatarTile(PSNProf);

RadFlipTileData tiledata = new RadFlipTileData();

tiledata.Count = new Random().Next(99);

tiledata.VisualElement = avatarTile;

LiveTileHelper.UpdateTile(tile2Update, tiledata);

});

PD: AvatarTile is the UserControl with image and other UIElements
how can accomplish to update the tile with the image from the background agent?

Thanks for your attention
Ste

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 08 Aug 2013, 08:17 AM
Hi Stefano,

Thanks for writing back.

I guess you have an Image element within your UserControl which is bound to the Uri of your remote image. The Image element downloads the image asynchronously and displays it as soon as it is put into the Silverlight Visual Tree. This is not the case in the background agent and therefore you do not see the image. You will have to manually download the image from the Uri, create a BitmapImage object from it and set it as a source to the Image element so that it renders.

I hope this helps.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
LiveTileHelper
Asked by
Stefano
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or