mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-02 10:07:15 +13:00
02ba400399
Forms replaced with WPF Migration not complete, yet Known open points marked with TODOs Limited and non-optimized feature set
31 lines
796 B
C#
31 lines
796 B
C#
// <copyright file="ActionCommand.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
//
|
|
// Copyright (c) 2022-2022 Peter Kirmeier
|
|
|
|
#nullable enable
|
|
|
|
namespace SystemTrayMenu.Utilities
|
|
{
|
|
using System;
|
|
using System.Windows.Input;
|
|
|
|
internal class ActionCommand : ICommand
|
|
{
|
|
private readonly Action<object> action;
|
|
|
|
public ActionCommand(Action<object> action)
|
|
{
|
|
this.action = action;
|
|
}
|
|
|
|
#pragma warning disable CS0067
|
|
public event EventHandler? CanExecuteChanged;
|
|
#pragma warning restore CS0067
|
|
|
|
public bool CanExecute(object? parameter) => true;
|
|
|
|
public void Execute(object? parameter) => action.Invoke(parameter!);
|
|
}
|
|
}
|