diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml b/VPet-Simulator.Core/Display/ToolBar.xaml index e4e29a5..35d9e5f 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml +++ b/VPet-Simulator.Core/Display/ToolBar.xaml @@ -16,7 +16,8 @@ - + diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml.cs b/VPet-Simulator.Core/Display/ToolBar.xaml.cs index fc11715..fde07c9 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml.cs +++ b/VPet-Simulator.Core/Display/ToolBar.xaml.cs @@ -72,5 +72,25 @@ namespace VPet_Simulator.Core { m.Core.Controller.ShowSetting(); } + + public void AddMenuButton(string parentMenu, + string displayName, + Action clickCallback) + { + var menuItem = new MenuItem() + { + Header = displayName, + }; + menuItem.Click += delegate + { + clickCallback?.Invoke(); + }; + switch (parentMenu) + { + case "投喂": + MenuFeed.Items.Add(menuItem); + break; + } + } } }