Skip to content

Commit

Permalink
Fix #20
Browse files Browse the repository at this point in the history
  • Loading branch information
i2van committed Oct 22, 2024
1 parent 81498bf commit 4e4bdfe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Hourglass/Extensions/WindowExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,17 @@ private static Rect Offset(this Rect rect)
/// Force window layout update.
/// </summary>
/// <param name="window">The window.</param>
public static void ForceUpdateLayout(this Window window) =>
window.Dispatcher.Invoke(EmptyAction, DispatcherPriority.Render);
public static void ForceUpdateLayout(this Window window)
{
try
{
window.Dispatcher.Invoke(EmptyAction, DispatcherPriority.Render);
}
catch(InvalidOperationException)
{
// Ignore.
}
}

/// <summary>
/// Open window context menu.
Expand Down

0 comments on commit 4e4bdfe

Please sign in to comment.