Browse Source

Merge pull request #9546 from AvaloniaUI/dispatcher-priority++

Changed the way DispatcherPriority values are defined, added PreComposition priority
pull/9563/head
Max Katz 3 years ago
committed by GitHub
parent
commit
e6b8754541
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      src/Avalonia.Base/Threading/DispatcherPriority.cs

29
src/Avalonia.Base/Threading/DispatcherPriority.cs

@ -45,32 +45,37 @@ namespace Avalonia.Threading
/// <summary>
/// The job will be processed after other non-idle operations have completed.
/// </summary>
public static readonly DispatcherPriority Background = new(1);
public static readonly DispatcherPriority Background = new(MinValue + 1);
/// <summary>
/// The job will be processed with the same priority as input.
/// </summary>
public static readonly DispatcherPriority Input = new(2);
public static readonly DispatcherPriority Input = new(Background + 1);
/// <summary>
/// The job will be processed after layout and render but before input.
/// </summary>
public static readonly DispatcherPriority Loaded = new(3);
public static readonly DispatcherPriority Loaded = new(Input + 1);
/// <summary>
/// The job will be processed with the same priority as render.
/// </summary>
public static readonly DispatcherPriority Render = new(5);
public static readonly DispatcherPriority Render = new(Loaded + 1);
/// <summary>
/// The job will be processed with the same priority as composition updates.
/// </summary>
public static readonly DispatcherPriority Composition = new(6);
public static readonly DispatcherPriority Composition = new(Render + 1);
/// <summary>
/// The job will be processed with the same priority as render.
/// The job will be processed with before composition updates.
/// </summary>
public static readonly DispatcherPriority PreComposition = new(Composition + 1);
/// <summary>
/// The job will be processed with the same priority as layout.
/// </summary>
public static readonly DispatcherPriority Layout = new(7);
public static readonly DispatcherPriority Layout = new(PreComposition + 1);
/// <summary>
/// The job will be processed with the same priority as data binding.
@ -80,7 +85,7 @@ namespace Avalonia.Threading
/// <summary>
/// The job will be processed before other asynchronous operations.
/// </summary>
public static readonly DispatcherPriority Send = new(8);
public static readonly DispatcherPriority Send = new(Layout + 1);
/// <summary>
/// Maximum possible priority
@ -123,4 +128,4 @@ namespace Avalonia.Threading
/// <inheritdoc />
public int CompareTo(DispatcherPriority other) => Value.CompareTo(other.Value);
}
}
}

Loading…
Cancel
Save