From 02752e0c338e92b8914128e096533ac9ad042d4a Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 23 Mar 2023 12:13:35 +0100 Subject: [PATCH] Update ShowWindowTest from master. This branch had gone out-of-sync due to repeated cherry picks. --- samples/IntegrationTestApp/ShowWindowTest.axaml | 15 ++++++++------- .../IntegrationTestApp/ShowWindowTest.axaml.cs | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/samples/IntegrationTestApp/ShowWindowTest.axaml b/samples/IntegrationTestApp/ShowWindowTest.axaml index 7c8cfd4553c..720ff6c344d 100644 --- a/samples/IntegrationTestApp/ShowWindowTest.axaml +++ b/samples/IntegrationTestApp/ShowWindowTest.axaml @@ -3,6 +3,7 @@ xmlns:integrationTestApp="clr-namespace:IntegrationTestApp" x:Class="IntegrationTestApp.ShowWindowTest" Name="SecondaryWindow" + x:DataType="Window" Title="Show Window Test"> @@ -14,14 +15,14 @@ - - + + - - - - - + + + + + diff --git a/samples/IntegrationTestApp/ShowWindowTest.axaml.cs b/samples/IntegrationTestApp/ShowWindowTest.axaml.cs index 00e44b85930..f0be34fdaa7 100644 --- a/samples/IntegrationTestApp/ShowWindowTest.axaml.cs +++ b/samples/IntegrationTestApp/ShowWindowTest.axaml.cs @@ -12,7 +12,7 @@ public class MeasureBorder : Border protected override Size MeasureOverride(Size availableSize) { MeasuredWith = availableSize; - + return base.MeasureOverride(availableSize); } @@ -35,11 +35,11 @@ public ShowWindowTest() { InitializeComponent(); DataContext = this; - PositionChanged += (s, e) => this.GetControl("Position").Text = $"{Position}"; + PositionChanged += (s, e) => this.GetControl("CurrentPosition").Text = $"{Position}"; if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - _orderTextBox = this.GetControl("Order"); + _orderTextBox = this.GetControl("CurrentOrder"); _timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(250) }; _timer.Tick += TimerOnTick; _timer.Start(); @@ -55,13 +55,13 @@ protected override void OnOpened(EventArgs e) { base.OnOpened(e); var scaling = PlatformImpl!.DesktopScaling; - this.GetControl("Position").Text = $"{Position}"; - this.GetControl("ScreenRect").Text = $"{Screens.ScreenFromVisual(this)?.WorkingArea}"; - this.GetControl("Scaling").Text = $"{scaling}"; + this.GetControl("CurrentPosition").Text = $"{Position}"; + this.GetControl("CurrentScreenRect").Text = $"{Screens.ScreenFromVisual(this)?.WorkingArea}"; + this.GetControl("CurrentScaling").Text = $"{scaling}"; if (Owner is not null) { - var ownerRect = this.GetControl("OwnerRect"); + var ownerRect = this.GetControl("CurrentOwnerRect"); var owner = (Window)Owner; ownerRect.Text = $"{owner.Position}, {PixelSize.FromSize(owner.FrameSize!.Value, scaling)}"; }