namespace Caliburn.Micro.Core {
using System;
using System.Threading.Tasks;
///
/// Enables easy marshalling of code to the UI thread.
///
public static class Execute {
///
/// Indicates whether or not the framework is in design-time mode.
///
public static bool InDesignMode {
get {
return PlatformProvider.Current.InDesignMode;
}
}
///
/// Executes the action on the UI thread asynchronously.
///
/// The action to execute.
public static void BeginOnUIThread(this Action action) {
PlatformProvider.Current.BeginOnUIThread(action);
}
///
/// Executes the action on the UI thread asynchronously.
///
/// The action to execute.
public static Task OnUIThreadAsync(this Action action) {
return PlatformProvider.Current.OnUIThreadAsync(action);
}
///
/// Executes the action on the UI thread.
///
/// The action to execute.
public static void OnUIThread(this Action action) {
PlatformProvider.Current.OnUIThread(action);
}
}
}