I have a very odd problem:
- In my C# code, if I set the "Topmost" property, the window does not stay on top.
- However, if I toggle this same property in Snoop, the windows stays on top.
My question is this: what is Snoop doing to force the window refresh?
What I have tried
I have tried the following:
window.UpdateLayout();window.InvalidateVisual();- Adding a background task to continuously set this property.
- Setting
TopMosttofalse, thentrue, to trigger a DependencyProperty refresh.

It turns out that Snoop was not doing anything special.
If I wait an additional 500 milliseconds, then it works:
Of course, adding specific times into an application is very hacky, so I'm currently looking for some method to determine if the window is properly set up.
Update
Puzzle solved, use the
Dispatcherselect an appropriate priority, see WPF: In an attached property, how to wait until visual tree loaded properly?