Skip to content

Commit

Permalink
fix(contentdialog): Fixed the ability to reopen a content dialog imme…
Browse files Browse the repository at this point in the history
…diatly after its closing.
  • Loading branch information
carldebilly committed Jan 13, 2022
1 parent 2a712f6 commit e4d5cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,9 @@ private MethodInfo[] FilterTests(UnitTestClassInfo testClassInfo, string[] filte
var testClassNameContainsFilters = filters?.Any(f => testClassInfo.Type.FullName.Contains(f, StrComp)) ?? false;
return testClassInfo.Tests
.Where(t => (filters?.None() ?? true)
|| testClassNameContainsFilters
|| filters.Any(f => t.DeclaringType.FullName.Contains(f, StrComp))
|| filters.Any(f => t.Name.Contains(f, StrComp)))
|| testClassNameContainsFilters
|| filters.Any(f => t.DeclaringType.FullName.Contains(f, StrComp))
|| filters.Any(f => t.Name.Contains(f, StrComp)))
.ToArray();
}

Expand Down Expand Up @@ -828,7 +828,6 @@ where asm.GetName().Name.EndsWith("tests", StringComparison.OrdinalIgnoreCase)
select type;

var types = GetType().GetTypeInfo().Assembly.GetTypes().Concat(testAssembliesTypes);
var ts = types.Select(t => t.FullName).ToArray();

return from type in types
where type.GetTypeInfo().GetCustomAttribute(typeof(TestClassAttribute)) != null
Expand Down
4 changes: 3 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/ContentDialog/ContentDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ void Complete(ContentDialogClosingEventArgs args)
_popup.Child = null;
UpdateVisualState();
Closed?.Invoke(this, new ContentDialogClosedEventArgs(result));
_tcs.SetResult(result);

(var tcs, _tcs) = (_tcs, null);
DispatcherQueue.TryEnqueue(() => tcs?.TrySetResult(result));
}
_hiding = false;
}
Expand Down

0 comments on commit e4d5cf9

Please sign in to comment.