From 76d72ab1bc66dbb9f27172e4ad511bf6ed374106 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Wed, 10 May 2023 16:09:54 +0200 Subject: [PATCH] feat: Support for UIElement.ActualOffset --- .../Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs | 11 +---------- src/Uno.UI/UI/Xaml/UIElement.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs index d7052025494c..8e3661eb6ff3 100644 --- a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs +++ b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs @@ -131,16 +131,7 @@ public bool UseLayoutRounding #endif // Skipping already declared property XamlRoot // Skipping already declared property Shadow - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] - public global::System.Numerics.Vector3 ActualOffset - { - get - { - throw new global::System.NotImplementedException("The member Vector3 UIElement.ActualOffset is not implemented. For more information, visit https://aka.platform.uno/notimplemented?m=Vector3%20UIElement.ActualOffset"); - } - } - #endif + // Skipping already declared property ActualOffset // Skipping already declared property ActualSize #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] diff --git a/src/Uno.UI/UI/Xaml/UIElement.cs b/src/Uno.UI/UI/Xaml/UIElement.cs index e2db4474cf11..0b763c83d11e 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.cs @@ -186,8 +186,16 @@ internal virtual bool GetDefaultValue2(DependencyProperty property, out object d return false; } + /// + /// Gets the size that this UIElement computed during the arrange pass of the layout process. + /// public Vector2 ActualSize => new Vector2((float)GetActualWidth(), (float)GetActualHeight()); + /// + /// Gets the position of this UIElement, relative to its parent, computed during the arrange pass of the layout process. + /// + public Vector3 ActualOffset => new Vector3((float)LayoutSlotWithMarginsAndAlignments.X, (float)LayoutSlotWithMarginsAndAlignments.Y, 0f); + /// /// Gets or sets the x, y, and z rendering position of the element. ///