AppEventsSample.Helpers.DispatcherHelper.Initialize C# (CSharp) Method

Initialize() public static method

This method should be called once on the UI thread to ensure that the UIDispatcher property is initialized.

In a Silverlight application, call this method in the Application_Startup event handler, after the MainPage is constructed.

In WPF, call this method on the static App() constructor.

public static Initialize ( ) : void
return void
        public static void Initialize()
        {
            if (UIDispatcher != null)
            {
                return;
            }

            UIDispatcher = Deployment.Current.Dispatcher;
        }