XAML-Map-Control/MapUiTools/WPF/MapMenuItem.WPF.cs

24 lines
556 B
C#
Raw Permalink Normal View History

using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
namespace MapControl.UiTools
{
2025-09-20 14:02:42 +02:00
public partial class MapMenuItem : MenuItem
{
2025-03-26 19:58:47 +01:00
protected MapMenuItem()
{
2025-09-20 14:02:42 +02:00
Loaded += (s, e) => Initialize();
Click += (s, e) => Execute();
2025-03-26 19:58:47 +01:00
}
public string Text
{
get => Header as string;
set => Header = value;
}
2025-03-21 18:03:57 +01:00
protected IEnumerable<MapMenuItem> ParentMenuItems => ((ItemsControl)Parent).Items.OfType<MapMenuItem>();
}
}