private void ChangeStatusViewLoad(object sender, EventArgs e) { if (_changeStatusPresenter == null) { _changeStatusPresenter = _presentersFactory.CreateChangeStatusPresenter(this, _routePointViewModel); _routePointViewModel = _changeStatusPresenter.Initialize(); ViewContainer.RegisterLeftAction(new Save(_changeStatusPresenter)); ViewContainer.RegisterRightAction(new Cancel(_changeStatusPresenter)); IEnumerable<StatusViewModel> statusViewModels = _changeStatusPresenter.GetStatuses(); foreach (var statusViewModel in statusViewModels) { var radioButton = new CustomRadioButton { Text = statusViewModel.Name, Checked = statusViewModel.Id == _routePointViewModel.StatusId, Dock = DockStyle.Top, Tag = statusViewModel, }; radioButton.CheckedEvent += RadioButtonCheckedChanged; Controls.Add(radioButton); } } }
public Cancel(ChangeStatusPresenter presenter) { _presenter = presenter; }
public Save(ChangeStatusPresenter presenter) { _presenter = presenter; }