using System.ComponentModel;
using System.Runtime.CompilerServices;
public static void Main()
Console.WriteLine("Hello World");
public class ViewModel: INotifyPropertyChanged
private bool enabled = false;
this.service = new Service();
this.service.StatusChanged += (o, e) => { enabled = e; Notify(nameof(Enabled)); };
public event PropertyChangedEventHandler PropertyChanged;
protected void Notify([CallerMemberName] string property = null)
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
internal event EventHandler<bool> StatusChanged;
internal bool IsRunning = false;
this.StatusChanged?.Invoke(this, this.IsRunning);
this.StatusChanged?.Invoke(this, this.IsRunning);