Fixed menu button selection

This commit is contained in:
Clemens 2022-01-21 18:37:05 +01:00
parent be0e06f581
commit 9a26fdaefc
2 changed files with 22 additions and 3 deletions

View file

@ -36,6 +36,8 @@ namespace MapControl.UiTools
#endif
public class MapLayersMenuButton : MenuButton
{
private UIElement selectedLayer;
public MapLayersMenuButton()
: base("\uE81E")
{
@ -108,7 +110,11 @@ namespace MapControl.UiTools
private void SetMapLayer(UIElement layer)
{
Map.MapLayer = layer;
if (selectedLayer != layer)
{
selectedLayer = layer;
Map.MapLayer = selectedLayer;
}
UpdateCheckedStates();
}