init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user