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

Changing Live Tile Items

2 Answers 72 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
Arash
Top achievements
Rank 1
Arash asked on 13 Oct 2016, 06:21 AM

hello 

i have a web service that is sending some data to my windows application every 10-15 seconds and i want to use those data as Light Visual Elements and add them to my live tile . also i want to use live tile transition animation .

but the problem is in all the sample i seen, coders always add their light vishal elements manually and when i want to add (and remove) items from my live tile every 10 - 15 second i lost my transition animation 

is there a  way that  i can receive data (text) from a source every x second and add them to livetile and remove old ones and  still keep my transition animation like the one in the demo application 

and i use the code below 

value = random.Next(200);
LiveTile.Items.Clear();
VisualElement.Text = value
VisualElement.TextAlignment = ContentAlignment.TopCenter;
LiveTile.TransitionType = ContentTransitionType.Fade;
LiveTile.Items.Add(VisualElement);

(assuming i declared my panorama and my tile group )

and this code is inside a timer and its running every x seconds.

Thanks 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 13 Oct 2016, 02:25 PM
Hello Arash,

Thank you for writing.

You can add LiveTileFrameElement. Here is an example for this:
Timer t = new Timer();
public RadForm1()
{
    InitializeComponent();
    t.Interval = 2000;
    t.Tick += T_Tick;
    radLiveTileElement2.TransitionType = ContentTransitionType.SlideLeft;
     
}
int count = 0;
private void T_Tick(object sender, EventArgs e)
{
    LiveTileFrameElement element = new LiveTileFrameElement();
    element.Text = "Frame" + count++;
    element.DrawFill = true;
    element.BackColor = Color.Red;
    radLiveTileElement2.Items.Add(element);
}
 
private void radButton1_Click(object sender, EventArgs e)
{
    t.Start();
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Arash
Top achievements
Rank 1
answered on 19 Oct 2016, 06:42 AM
Yeah this worked out very fine . Thank you very much for your help . 
Tags
Panorama
Asked by
Arash
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Arash
Top achievements
Rank 1
Share this question
or