WPF Popup 控件致使被遮挡内容不刷新的缘由this
周银辉spa
今天在写一个WPF控件时用到了Popup控件,很郁闷的状况是:当popup关闭时,原来被popup挡住的界面部分不刷新,非要手动刷新一下(好比最大最小化一下窗口),就连网上传说的这个方法也不行blog
public static class UiHelper { private delegate void NoArgDelegate(); public static void Refresh(this UIElement obj) { obj.Dispatcher.Invoke(DispatcherPriority.Render, (NoArgDelegate)delegate { }); } }
原来是AllowsTransparency这个属性引发的,将其设置为true就能够了it