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

@ -33,16 +33,11 @@ namespace MapControl.UiTools
{
DataContext = Map;
if (Items.Count > 0)
if (Items.Count > 0 &&
Items[0] is MapMenuItem item &&
await item.Execute(Map))
{
if (Items[0] is MapLayerMenuItem mapLayerItem)
{
await mapLayerItem.Execute(Map);
}
else if (Items[0] is MapProjectionMenuItem mapProjectionItem)
{
mapProjectionItem.Execute(Map);
}
item.IsChecked = true;
}
}
}