Убраны синхронные методы

This commit is contained in:
2026-01-25 01:52:03 +03:00
parent 79bdd8bc62
commit a6ee6fcb36
22 changed files with 1108 additions and 2137 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.UI.Xaml;
namespace Lattice.UI.DragDrop.WinUI.Helpers;
public static class FrameworkElementExtensions
{
/// <summary>
/// Получает фактические размеры FrameworkElement.
/// </summary>
public static Windows.Foundation.Size GetActualSize(this FrameworkElement element)
{
return new Windows.Foundation.Size(element.ActualWidth, element.ActualHeight);
}
/// <summary>
/// Получает границы элемента в экранных координатах.
/// </summary>
public static Windows.Foundation.Rect GetScreenBounds(this FrameworkElement element)
{
var transform = element.TransformToVisual(null);
var topLeft = transform.TransformPoint(new Windows.Foundation.Point(0, 0));
var bottomRight = transform.TransformPoint(new Windows.Foundation.Point(element.ActualWidth, element.ActualHeight));
return new Windows.Foundation.Rect(topLeft, bottomRight);
}
}