Skip to content

Commit

Permalink
fix: The parent of FrameworkElement is always null in GenerateBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
workgroupengineering committed Apr 21, 2022
1 parent a926d5d commit 9f890c9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public partial class SampleChooserViewModel

private Section _lastSection = Section.Library;
private readonly Stack<Section> _previousSections = new Stack<Section>();
private bool _isRecordAllTests = false;

// A static instance used during UI Testing automation
public static SampleChooserViewModel Instance { get; private set; }
Expand Down Expand Up @@ -267,6 +268,7 @@ internal async Task RecordAllTests(CancellationToken ct, string screenShotPath =
{
try
{
_isRecordAllTests = true;
IsSplitVisible = false;

var folderName = Path.Combine(screenShotPath, "UITests-" + DateTime.Now.ToString("yyyyMMdd-hhmmssfff", CultureInfo.InvariantCulture));
Expand All @@ -277,7 +279,12 @@ await Window.Current.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
async () =>
{
await RecordAllTestsInner(folderName, ct, doneAction);
try {
await RecordAllTestsInner(folderName, ct, doneAction);
}
finally {
_isRecordAllTests = false;
}
});
}
catch (Exception e)
Expand Down Expand Up @@ -467,6 +474,10 @@ private void ObserveChanges()

void Update(SampleChooserContent newContent)
{
if (_isRecordAllTests)
{
return;
}
var unused = Window.Current.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
async () =>
Expand Down

0 comments on commit 9f890c9

Please sign in to comment.