File scoped namespaces

This commit is contained in:
ClemensFischer 2026-04-13 17:14:49 +02:00
parent c14377f976
commit 65aba44af6
152 changed files with 11962 additions and 12115 deletions

View file

@ -8,21 +8,20 @@ using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl.UiTools
namespace MapControl.UiTools;
public abstract partial class MapMenuItem : ToggleMenuFlyoutItem
{
public abstract partial class MapMenuItem : ToggleMenuFlyoutItem
protected MapMenuItem()
{
protected MapMenuItem()
Loaded += (_, _) =>
{
Loaded += (_, _) =>
{
ParentMenuItems = ((Panel)VisualTreeHelper.GetParent(this)).Children.OfType<MapMenuItem>().ToList();
Initialize();
};
ParentMenuItems = ((Panel)VisualTreeHelper.GetParent(this)).Children.OfType<MapMenuItem>().ToList();
Initialize();
};
Click += (_, _) => Execute();
}
protected IList<MapMenuItem> ParentMenuItems { get; private set; }
Click += (_, _) => Execute();
}
protected IList<MapMenuItem> ParentMenuItems { get; private set; }
}

View file

@ -7,25 +7,24 @@ using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
#endif
namespace MapControl.UiTools
namespace MapControl.UiTools;
[ContentProperty(Name = nameof(Items))]
public partial class MenuButton
{
[ContentProperty(Name = nameof(Items))]
public partial class MenuButton
public MenuButton()
{
public MenuButton()
{
Flyout = new MenuFlyout();
Loaded += async (_, _) => await Initialize();
}
public string Icon
{
get => (Content as FontIcon)?.Glyph;
set => Content = new FontIcon { Glyph = value };
}
public MenuFlyout Menu => (MenuFlyout)Flyout;
public IList<MenuFlyoutItemBase> Items => Menu.Items;
Flyout = new MenuFlyout();
Loaded += async (_, _) => await Initialize();
}
public string Icon
{
get => (Content as FontIcon)?.Glyph;
set => Content = new FontIcon { Glyph = value };
}
public MenuFlyout Menu => (MenuFlyout)Flyout;
public IList<MenuFlyoutItemBase> Items => Menu.Items;
}