public static class ExtensionMethods
{
private static readonly Action EmptyDelegate = delegate { };
public static void Refresh(this UIElement uiElement)
{
uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
}
}
//call on any UI Element like so:
//element.Refresh();
private void Button_RefreshControls_Click(object sender, RoutedEventArgs e)
{
ShowCustomerControl.Refresh();
}