Changing Live Tile Items

3 posts, 1 answers
  1. Arash
    Arash avatar
    2 posts
    Member since:
    Oct 2016

    Posted 13 Oct Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 13 Oct Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Arash
    Arash avatar
    2 posts
    Member since:
    Oct 2016

    Posted 19 Oct in reply to Dimitar Link to this post

    Yeah this worked out very fine . Thank you very much for your help . 
Back to Top