Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Call webService in Timer event? RSS

13 replies

Last post Mar 13, 2008 10:19 PM by jackbond

(0)
  • Nokola

    Nokola

    Member

    66 Points

    13 Posts

    Microsoft

    Re: Call webService in Timer event?

    Mar 13, 2008 09:39 PM | LINK

    DispatcherTimer is probably preferred (easier to read) in this case. The Dispatcher.BeginInvoke is the usual "invoke on UI thread' code that I use so it came first to mind.

     

    -------
    Please mark this post as answer if it answers your question!
    Nikola - MSFT
    http://blogs.msdn.com/nikola

  • jackbond

    jackbond

    Contributor

    5812 Points

    1559 Posts

    Re: Call webService in Timer event?

    Mar 13, 2008 09:50 PM | LINK

    Nokola

    DispatcherTimer is probably preferred (easier to read) in this case.

    I saw your post here and your blog entry. They're a little confusing as you are creating a Timer with the sole purpose of invoking on the ui thread, which is basically the DispatcherTimer's job.

  • Nokola

    Nokola

    Member

    66 Points

    13 Posts

    Microsoft

    Re: Call webService in Timer event?

    Mar 13, 2008 10:03 PM | LINK

    jackbond

    Nokola

    DispatcherTimer is probably preferred (easier to read) in this case.

    I saw your post here and your blog entry. They're a little confusing as you are creating a Timer with the sole purpose of invoking on the ui thread, which is basically the DispatcherTimer's job.

    Thank you for your comment. I agree that DispatcherTimer is better for ontimer events, and also updated this on my blog. btw, I also referenced back to you and this forum for more clarification, hope you don't mind.

    DispatcherTimer timer = new DispatcherTimer();
    timer.Interval = new TimeSpan(1000);
    timer.Tick += new EventHandler(timer_Tick);
    timer.Start();

    Thanks,

     

    silverlight Timer we services Threading

    -------
    Please mark this post as answer if it answers your question!
    Nikola - MSFT
    http://blogs.msdn.com/nikola

  • jackbond

    jackbond

    Contributor

    5812 Points

    1559 Posts

    Re: Call webService in Timer event?

    Mar 13, 2008 10:19 PM | LINK

    Nokola

    hope you don't mind

    Not at all, thanks for clarifying.