Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Get the Silverlight Main Dispatcher before the RootVisual has been assigned

0.00/5 (No votes)
27 Feb 2010 1  
Ordinarily the Application.Current.RootVisual.Dispatcher property is used to retrieve the System.Windows.Threading.Dispatcher for an application. Of course this won't work if performed before the RootVisual has been assigned. To get the Dispatcher for an application before the RootVisual has...
Ordinarily the Application.Current.RootVisual.Dispatcher property is used to retrieve the System.Windows.Threading.Dispatcher for an application. Of course this won't work if performed before the RootVisual has been assigned. To get the Dispatcher for an application before the RootVisual has been assigned, use the System.Windows.Deployment.Current.Dispatcher property.

C#:
C#
var dispatcher = Deployment.Current.Dispatcher;


VB.NET:
VB.NET
Dim dispatcher As Dispatcher = Deployment.Current.Dispatcher

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here