[英]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.