[英]How to force the refresh of the thumbnail when the window is minimized ? (C# WPF)
[英]With WPF, how does Snoop force a window refresh on a property change?
事实证明,史努比没有做任何特别的事情。
如果我再等待500毫秒,则可以:
Task task = Task.Run(
async () =>
{
// Without this delay, the change will not work.
await Task.Delay(TimeSpan.FromMilliseconds(500));
Application.Current.Dispatcher.Invoke(
() =>
{
floatingPaneWindow.Topmost = true;
{
if (window.Top < 0)
{
window.Top = 0;
}
if (window.Left < 0)
{
window.Left = 0;
}
}
});
});
当然,在应用程序中添加特定的时间是很棘手的,所以我目前正在寻找确定窗口是否正确设置的方法。
拼图解决后,使用Dispatcher
选择适当的优先级,请参阅WPF:在附加属性中,如何等待直到视觉树正确加载?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.