27 lines
603 B
C#
27 lines
603 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
|
|
namespace YouTubeViewers.WPF.Commands
|
|
{
|
|
public abstract class CommandBase : ICommand
|
|
{
|
|
public event EventHandler? CanExecuteChanged;
|
|
|
|
public virtual bool CanExecute(object? parameter)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public abstract void Execute(object? parameter);
|
|
|
|
protected virtual void OnCanExecuteChanged()
|
|
{
|
|
CanExecuteChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|