C# 클래스 AppEventsSample.Helpers.DispatcherHelper

Helper class for dispatcher operations on the UI thread.
파일 보기 프로젝트 열기: dkarzon/AppEvents

공개 메소드들

메소드 설명
Initialize ( ) : void

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.

SafeDispatch ( System.Action action ) : void

Executes an action on the UI thread. If this method is called from the UI thread, the action is executed immendiately. If the method is called from another thread, the action will be enqueued on the UI thread's dispatcher and executed asynchronously.

For additional operations on the UI thread, you can get a reference to the UI thread's dispatcher thanks to the property UIDispatcher

.

메소드 상세

Initialize() 공개 정적인 메소드

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
리턴 void

SafeDispatch() 공개 정적인 메소드

Executes an action on the UI thread. If this method is called from the UI thread, the action is executed immendiately. If the method is called from another thread, the action will be enqueued on the UI thread's dispatcher and executed asynchronously.

For additional operations on the UI thread, you can get a reference to the UI thread's dispatcher thanks to the property UIDispatcher

.
public static SafeDispatch ( System.Action action ) : void
action System.Action The action that will be executed on the UI /// thread.
리턴 void