Move Execute method to base class

This commit is contained in:
ClemensFischer 2025-03-21 18:03:57 +01:00
parent a1b10b6e08
commit 45ab678d5b
6 changed files with 43 additions and 29 deletions

View file

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
#if UWP
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
@ -10,9 +11,11 @@ using Microsoft.UI.Xaml.Media;
namespace MapControl.UiTools
{
public class MapMenuItem : ToggleMenuFlyoutItem
public abstract class MapMenuItem : ToggleMenuFlyoutItem
{
public abstract Task<bool> Execute(MapBase map);
protected IEnumerable<MapMenuItem> ParentMenuItems
=> (VisualTreeHelper.GetParent(this) as Panel)?.Children.OfType<MapMenuItem>();
=> ((Panel)VisualTreeHelper.GetParent(this)).Children.OfType<MapMenuItem>();
}
}