/// <summary> /// Constructor for <see cref="MainWindowViewModel"/>. /// </summary> public MainWindowViewModel() { var grid = new MonoLifeGrid <bool>(new bool[DefaultFieldWidth, DefaultFieldHeight], Guid.NewGuid()); _doubleStateLife = new DoubleStateLife(grid); StartCommand = new DelegateCommand(Start); StopCommand = new DelegateCommand(Stop); SaveCommand = new DelegateCommand(Save); ExitCommand = new DelegateCommand(Exit); OpenCommand = new DelegateCommand(Open); NewCommand = new DelegateCommand(New); AboutCommand = new DelegateCommand(About); }
private void MonoLifeGridModelChanged(MonoLifeGrid <bool> lastGrid) { if (CanvasRef == null) { return; } var lastLifeId = lastGrid?.LifeId; if (Dispatcher.CheckAccess()) { GridRender(lastLifeId); } else { Dispatcher.Invoke(new Action(() => GridRender(lastLifeId))); } }
private void New(object obj) { var grid = new MonoLifeGrid <bool>(new bool[DefaultFieldWidth, DefaultFieldHeight], Guid.NewGuid()); DoubleStateLife = new DoubleStateLife(grid); }