Skip to content

Commit

Permalink
Use explicit InvokeAsync when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Dec 19, 2024
1 parent 76029d0 commit e971ee8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
- Fix access level for log queue
- Fix access level for log document
- Simplify ProcessLogLine method
- Use explicit InvokeAsync when possible

### 3.2.4 (2024-11-24)

Expand Down
6 changes: 5 additions & 1 deletion MPF.UI/UserControls/LogOutput.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class LogOutput : UserControl
/// <summary>
/// Document representing the text
/// </summary>
private readonly FlowDocument _document;
private readonly FlowDocument _document;

/// <summary>
/// Queue of items that need to be logged
Expand Down Expand Up @@ -129,7 +129,11 @@ internal void ProcessLogLine(LogLine logLine)
if (nextText == null)
return;

#if NET40
Dispatcher.Invoke(() =>
#else
Dispatcher.InvokeAsync(() =>
#endif
{
var run = logLine.GenerateRun();
_paragraph.Inlines.Add(run);
Expand Down

0 comments on commit e971ee8

Please sign in to comment.