There is no way to synchronize with a completed render #5653
Unanswered
ClosetBugSlayer
asked this question in
Q&A
Replies: 1 comment
-
How about Dispatcher the action with DispatcherPriority.Render or low? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is no way to block until elements are guaranteed re-rendered.
I have a topmost window that has a color-tinted transparency with opacity 0.15. When the user does an action, I need to clear the tint and take a screenshot through it without mouse input affecting the controls underneath (tooltips, etc). I can never seem to get the timing right between the removal of the tint and the re-rendering of the window before taking the screenshot. As a result, the screenshot always has the tint over it.
I called InvalidateVisual, InvalidateArrange, InvalidateMeasure, UpdateLayout.
Waiting for CompositionTarget.Rendering doesn't work.
Waiting for Window.ContentRendered doesn't work.
Waiting for DispatcherPriority.ContextIdle doesn't work.
Waiting for all three combined doesn't work.
There is literally nothing I can wait for except a fixed amount of time which is not gonna cut it. There's always lag time between these events and there is NO way to account for it. There is no solution online.
Others complaining about same thing:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/693fbedb-efa6-413e-ab66-530c6961d3fb/how-to-wait-for-the-wpf-render-thread-to-quotcatch-upquot?forum=wpf
Beta Was this translation helpful? Give feedback.
All reactions