Skip to content

Commit

Permalink
feat: Support for UIElement.ActualOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed May 10, 2023
1 parent bc8e5b6 commit 76d72ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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__")]
Expand Down
8 changes: 8 additions & 0 deletions src/Uno.UI/UI/Xaml/UIElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,16 @@ internal virtual bool GetDefaultValue2(DependencyProperty property, out object d
return false;
}

/// <summary>
/// Gets the size that this UIElement computed during the arrange pass of the layout process.
/// </summary>
public Vector2 ActualSize => new Vector2((float)GetActualWidth(), (float)GetActualHeight());

/// <summary>
/// Gets the position of this UIElement, relative to its parent, computed during the arrange pass of the layout process.
/// </summary>
public Vector3 ActualOffset => new Vector3((float)LayoutSlotWithMarginsAndAlignments.X, (float)LayoutSlotWithMarginsAndAlignments.Y, 0f);

/// <summary>
/// Gets or sets the x, y, and z rendering position of the element.
/// </summary>
Expand Down

0 comments on commit 76d72ab

Please sign in to comment.