Skip to content

Commit 7f4de11

Browse files
authored
Remove ConfigureAwait(false) from system dialog classes (#118)
1 parent 467e029 commit 7f4de11

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/Modern.Forms/Application.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public static void Exit ()
7272
/// <param name="mainForm">A Form that represents the form to make visible.</param>
7373
public static void Run (Form mainForm)
7474
{
75+
AvaloniaSynchronizationContext.InstallIfNeeded ();
76+
7577
mainForm.Show ();
7678
Run ((ICloseable)mainForm);
7779
}
@@ -85,6 +87,7 @@ public static void Run (ICloseable closable)
8587
if (_mainLoopCancellationTokenSource != null)
8688
throw new InvalidOperationException ("Run should only be called once");
8789

90+
AvaloniaSynchronizationContext.InstallIfNeeded ();
8891
closable.Closed += (s, e) => Exit ();
8992

9093
_mainLoopCancellationTokenSource = new CancellationTokenSource ();

src/Modern.Forms/FolderBrowserDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task<DialogResult> ShowDialog (Form owner)
2525
Title = Title
2626
};
2727

28-
var result = await parent.OpenFolderPickerAsync (options).ConfigureAwait (false);
28+
var result = await parent.OpenFolderPickerAsync (options);
2929

3030
var paths = result.Select (f => f.GetFullPath ()).WhereNotNull ();
3131

src/Modern.Forms/OpenFileDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public async Task<DialogResult> ShowDialog (Form owner)
2626
FileTypeFilter = filters
2727
};
2828

29-
var result = await parent.OpenFilePickerAsync (options).ConfigureAwait (false);
29+
var result = await parent.OpenFilePickerAsync (options);
3030

3131
FileNames.Clear ();
3232

src/Modern.Forms/SaveFileDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task<DialogResult> ShowDialog (Form owner)
2727
FileTypeChoices = filters
2828
};
2929

30-
var result = await parent.SaveFilePickerAsync (options).ConfigureAwait (false);
30+
var result = await parent.SaveFilePickerAsync (options);
3131

3232
FileNames.Clear ();
3333

0 commit comments

Comments
 (0)