Files

34 lines
870 B
C#
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using DTS.Common.Interface.Menu.HamburgerMenu;
using System;
using System.Windows.Input;
namespace HamburgerMenu.Model
{
/// <summary>
/// this is a simple menu command handler that just notifies when the command is executed
/// </summary>
public class MenuCommand : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
MenuItemPressed?.Invoke(Id);
}
private readonly MenuItemPressedDelegate MenuItemPressed;
private readonly string Id;
public MenuCommand(string id, MenuItemPressedDelegate menuItemPressed)
{
Id = id;
MenuItemPressed = menuItemPressed;
}
}
}