Files
BeWoPlaner/Shared/Extensions/ControlExtensions.cs
2016-06-27 01:45:38 +02:00

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);
}
}
}