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#:
var dispatcher = Deployment.Current.Dispatcher;
VB.NET:
Dim dispatcher As Dispatcher = Deployment.Current.Dispatcher
Daniel is a former senior engineer in Technology and Research at the Office of the CTO at Microsoft, working on next generation systems.
Previously Daniel was a nine-time Microsoft MVP and co-founder of
Outcoder, a Swiss software and consulting company.
Daniel is the author of Windows Phone 8 Unleashed and Windows Phone 7.5 Unleashed, both published by SAMS.
Daniel is the developer behind several acclaimed mobile apps including
Surfy Browser for Android and Windows Phone. Daniel is the creator of a number of popular open-source projects, most notably
Codon.
Would you like Daniel to bring value to your organisation?
Please contact
Blog |
Twitter
Xamarin Experts
Windows 10 Experts