Browse Source

Fix for Issue 9064 - Dispatcher call instead

https://github.com/AvaloniaUI/Avalonia/issues/9064

Fix for throwing unhandled exception in screen page, replace direct invalidate visual with dispatcher invocation of invalidate visual
pull/9065/head
ShadowMarker789 3 years ago
committed by GitHub
parent
commit
1aa44984b7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      samples/ControlCatalog/Pages/ScreenPage.cs

3
samples/ControlCatalog/Pages/ScreenPage.cs

@ -6,6 +6,7 @@ using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Platform;
using Avalonia.Rendering;
using Avalonia.Threading;
namespace ControlCatalog.Pages
{
@ -40,7 +41,7 @@ namespace ControlCatalog.Pages
if (screen.Bounds.X / 10f < _leftMost)
{
_leftMost = screen.Bounds.X / 10f;
InvalidateVisual();
Dispatcher.UIThread.Post(InvalidateVisual, DispatcherPriority.Background);
return;
}

Loading…
Cancel
Save