WPF PropertyModel, Command

Eden·2024년 6월 19일
0
class PropertyModel : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged = delegate { };

    public void UpdateProperty(params string[] properties)
    {
        foreach (var property in properties)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
    }
}
public class Command : ICommand
{
    public event EventHandler CanExecuteChanged;

    public bool CanExecute(object parameter)
    {
        return true;
    }

    public void Execute(object parameter)
    {
        this.DoAction?.Invoke();
    }
    public Action DoAction { get; set; }
}
profile
주섬주섬..

0개의 댓글