LoginSignup
1

More than 5 years have passed since last update.

DispatcherHelperクラス(MVVM Light Toolkit リファレンス)

Posted at

DispatcherHelper

概要

public static class DispatcherHelper
  • UIスレッドでメソッドを実行するためのヘルパー・クラス。
名前空間
  • GalaSoft.MvvmLight.Threading

アセンブリ

  • GalaSoft.MvvmLight

メソッド

CheckBeginInvokeOnUI

CheckBeginInvokeOnUI
public static void CheckBeginInvokeOnUI(System.Action action)
概要
  • actionをUIスレッドで実行する。
  • このメソッドをUIスレッドから呼んだ場合、actionを同期的に実行する。
  • このメソッドをUIスレッド以外から呼んだ場合、actionをUIスレッドのディスパッチャーの待ち行列に入れ、非同期に実行する。

Initialize

Initialize
public static void Initialize()
概要
  • このメソッドをUIスレッドから呼び、UIDispatcherプロパティをUIスレッドのディスパッチャーで初期化する。
  • WPFでは、Appクラスの静的コンストラクターから呼ぶとよい。

Reset

Reset
public static void Reset()
概要
  • UIDispatcherプロパティをnullにする。

RunAsync

RunAsync
public static System.Windows.Threading.DispatcherOperation RunAsync(System.Action action)
概要
  • actionをUIスレッドのディスパッチャーの待ち行列に入れ、非同期に実行する。
戻り値
  • UIスレッドのディスパッチャーの待ち行列に入れた操作にアクセスするためのオブジェクト。

プロパティ

UIDispatcher

UIDispatcher
public static System.Windows.Threading.Dispatcher UIDispatcher { get; private set; }

概要
  • UIスレッドのディスパッチャーを戻す。

参照

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1