22 lines
583 B
C#
22 lines
583 B
C#
using System;
|
|
using System.Windows.Threading;
|
|
using System.Windows;
|
|
|
|
namespace BS.Shared.Extensions
|
|
{
|
|
public static class ControlExtensions
|
|
{
|
|
public static void Dispatch(this DispatcherObject p, Action pAction)
|
|
{
|
|
p.Dispatcher.BeginInvoke(DispatcherPriority.Normal, pAction);
|
|
}
|
|
|
|
private static Action EmptyDelegate = delegate() { };
|
|
|
|
|
|
public static void RefreshUI(this UIElement uiElement)
|
|
{
|
|
uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
|
|
}
|
|
}
|
|
} |