2016-06-27 01:45:38 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BS.Shared.Extensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class ControlExtensions
|
|
|
|
|
|
{
|
2025-10-27 08:32:36 +01:00
|
|
|
|
public static void Dispatch(this DispatcherObject p, Action pAction, DispatcherPriority dispatcherPriority = DispatcherPriority.Normal)
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2025-10-27 08:32:36 +01:00
|
|
|
|
p.Dispatcher.BeginInvoke(dispatcherPriority, pAction);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static Action EmptyDelegate = delegate() { };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void RefreshUI(this UIElement uiElement)
|
|
|
|
|
|
{
|
|
|
|
|
|
uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|