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

@ -2,32 +2,31 @@
using System.Windows.Controls;
using System.Windows.Markup;
namespace MapControl.UiTools
namespace MapControl.UiTools;
[ContentProperty(nameof(Items))]
public partial class MenuButton
{
[ContentProperty(nameof(Items))]
public partial class MenuButton
static MenuButton()
{
static MenuButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuButton), new FrameworkPropertyMetadata(typeof(MenuButton)));
}
public MenuButton()
{
ContextMenu = new ContextMenu();
DataContextChanged += (_, e) => ContextMenu.DataContext = e.NewValue;
Loaded += async (_, _) => await Initialize();
Click += (_, _) => ContextMenu.IsOpen = true;
}
public string Icon
{
get => Content as string;
set => Content = value;
}
public ContextMenu Menu => ContextMenu;
public ItemCollection Items => ContextMenu.Items;
DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuButton), new FrameworkPropertyMetadata(typeof(MenuButton)));
}
public MenuButton()
{
ContextMenu = new ContextMenu();
DataContextChanged += (_, e) => ContextMenu.DataContext = e.NewValue;
Loaded += async (_, _) => await Initialize();
Click += (_, _) => ContextMenu.IsOpen = true;
}
public string Icon
{
get => Content as string;
set => Content = value;
}
public ContextMenu Menu => ContextMenu;
public ItemCollection Items => ContextMenu.Items;
}