日常更新
This commit is contained in:
@@ -38,6 +38,15 @@ namespace Ramitta.lib
|
||||
{
|
||||
if (text!=null)obj.Content = text;
|
||||
if (color != null) obj.Background = color;
|
||||
|
||||
|
||||
// 强制刷新UI
|
||||
obj.InvalidateVisual();
|
||||
obj.InvalidateArrange();
|
||||
obj.InvalidateMeasure();
|
||||
obj.UpdateLayout();
|
||||
// 处理Dispatcher队列中的其他挂起的操作,确保UI更新
|
||||
Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user