fix: fix drawer measure

This commit is contained in:
Dong Bin
2025-02-08 02:11:21 +08:00
parent 8dbdc95a9a
commit 4893e6efb4
4 changed files with 127 additions and 161 deletions

View File

@@ -57,10 +57,10 @@ public class DrawerMeasureTest
};
window.Show();
Dispatcher.UIThread.RunJobs();
var d = window.GetVisualDescendants().ToList();
Drawer.ShowCustom(textBlock, "hello world", null,
new DrawerOptions { Position = position, TopLevelHashCode = window.GetHashCode() });
await Task.Delay(TimeSpan.FromSeconds(0.1));
var d = window.GetVisualDescendants().ToList();
var dialogControl = window.GetVisualDescendants().OfType<CustomDrawerControl>().SingleOrDefault();
Assert.NotNull(dialogControl);
Assert.True(dialogControl.Bounds.Width <= window.Bounds.Width);