In C#, how do you send a refresh/repaint message to a WPF grid or canvas?

吃可爱长大的小学妹 提交于 2019-11-30 21:35:13
DevDemon

Refresh update WPF Controls like Winforms

public static class ExtensionMethods
{
   private static Action EmptyDelegate = delegate() { };

   public static void Refresh(this UIElement uiElement)
   {
      uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
   }
}

I'm used to winforms so this is only a guess, but look for an Invalidate() method.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!