mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Remove CanvasPanel
This commit is contained in:
parent
22d5aadb9d
commit
3a9050676c
6 changed files with 10 additions and 75 deletions
|
|
@ -71,8 +71,6 @@ namespace MapControl
|
|||
|
||||
protected virtual void UpdateData()
|
||||
{
|
||||
MapPanel.SetLocation(this, Location);
|
||||
|
||||
if (parentMap != null && Location != null && Data != null)
|
||||
{
|
||||
var matrix = parentMap.GetMapTransform(Location);
|
||||
|
|
@ -86,6 +84,8 @@ namespace MapControl
|
|||
Data.Transform = new MatrixTransform { Matrix = matrix };
|
||||
}
|
||||
}
|
||||
|
||||
MapPanel.SetLocation(this, Location);
|
||||
}
|
||||
|
||||
#region Methods used only by derived classes MapPolyline, MapPolygon and MapMultiPolygon
|
||||
|
|
|
|||
|
|
@ -230,9 +230,6 @@
|
|||
<Compile Include="..\WinUI\Animatable.WinUI.cs">
|
||||
<Link>Animatable.WinUI.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\WinUI\CanvasPanel.cs">
|
||||
<Link>CanvasPanel.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\WinUI\GeoImage.WinUI.cs">
|
||||
<Link>GeoImage.WinUI.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// Copyright © 2023 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System.Linq;
|
||||
using Windows.Foundation;
|
||||
#if WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
#elif UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Replacement for WinUI and UWP Canvas, which clips MapPath child elements.
|
||||
/// </summary>
|
||||
public class CanvasPanel : Panel
|
||||
{
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
availableSize = new Size(double.PositiveInfinity, double.PositiveInfinity);
|
||||
|
||||
foreach (var element in Children.OfType<UIElement>())
|
||||
{
|
||||
element.Measure(availableSize);
|
||||
}
|
||||
|
||||
return new Size();
|
||||
}
|
||||
|
||||
protected override Size ArrangeOverride(Size finalSize)
|
||||
{
|
||||
foreach (var element in Children.OfType<UIElement>())
|
||||
{
|
||||
var x = Canvas.GetLeft(element);
|
||||
var y = Canvas.GetTop(element);
|
||||
var size = MapPanel.GetDesiredSize(element);
|
||||
|
||||
element.Arrange(new Rect(x, y, size.Width, size.Height));
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue