Recommended

Skip Navigation LinksHome / Search

Search

 
Results Per Page

Found 2 results for UI Thread.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Order by Publish Date   Ascending Title   Rating  

  • Asynchronous test support

    0 comments  /  posted by  Silverlight Show  on  Mar 05, 2009 (more than a year ago)
    Tags: Silverlight Unit Test Framework , Silverlight Control Toolkit , Framework , UI Thread , Unit Tests , Silverlight , Jeff Wilcox

    Jeff Wilcox has a post about Silverlight unit test framework and the UI thread.

    The Silverlight unit test framework has built-in functionality for some unique situations that pop up when you are testing key applications and components on the Silverlight platform. In fact, the entire framework has been built around the idea of performing a majority of the unit testing on the user interface thread, right inside the browser, as a Silverlight application itself.



  • 2 comments  /  posted by  Denislav Savkov  on  Aug 29, 2008 (more than a year ago)

    If you have used multiple threads or just timers in your applications, you probably know that if you have to update any user interface, control you should not do it from any other thread but from the one that the control was created from. That is why if your application uses multiple threads, you always have to be aware of what thread you are in.
    In Silverlight invoking a piece of code in the user interface thread can be achieved by using the BeginInvoke method of the System.Windows.Threading.Dispatcher class. However you cannot create an instance of the Dispatcher class but you can use the one each object that derives from System.Windows.DependencyObject exposes through its Dispatcher property.
    Check out the code snippet bellow:

    C#

    // Method executed in some other non UI thread!
    private void OtherThreadMethod()
    {
        //Invoke the method that should change the control in the UI thread
        this.Dispatcher.BeginInvoke( UIThreadMethod );
    }
     
    private void UIThreadMethod()
    {
        //Perform the change of the control
        this.Cursor = Cursors.Wait;
    }
    That's it!

Join the free SilverlightShow webinar 'Silverlight's Power Features: Data Binding in Action' on August 19th 2010, 10:00 am PDT.
In this session Gill Cleeren will make with a complete overview of the data binding features Silverlight 4 has to offer. He will discuss how data binding is the enabler for applying the MVVM pattern and commanding, and will end up reviewing Blend's support for data binding, including the use of design-time data. Read more | Register Now (hide this)