1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.UI.Shared/NullCommand.cs
Robert 372991a69b UI - Fixed a lot of binding errors
UI - Added most missing DisposeWith calls
2022-04-02 01:10:06 +02:00

36 lines
837 B
C#

using System;
using System.Windows.Input;
namespace Artemis.UI.Shared;
/// <summary>
/// Represents a placeholder command that does nothing and can't be executed.
/// </summary>
public class NullCommand : ICommand
{
private static readonly Lazy<NullCommand> _instance = new(() => new NullCommand());
private NullCommand()
{
}
/// <summary>
/// Gets the static instance of this command.
/// </summary>
public static ICommand Instance => _instance.Value;
/// <inheritdoc />
public event EventHandler? CanExecuteChanged;
/// <inheritdoc />
public void Execute(object? parameter)
{
throw new InvalidOperationException("NullCommand cannot be executed");
}
/// <inheritdoc />
public bool CanExecute(object? parameter)
{
return false;
}
}