public bool OnViewClosing(bool userClosing) { EnsureState(); if (userClosing && Order.IsDirty) { var messageBoxView = _viewFactory.CreateMessageBoxView(); return(messageBoxView.ShowYesNo("Changes have not been saved. Are you sure you want to continue?", "Order Not Saved")); } _dataBinder.RebindUI(this, false, false); return(true); }
public void OnDeleteButtonClick() { EnsureState(); var confirmView = _viewFactory.CreateMessageBoxView(); if (confirmView.ShowYesNo("Are you sure you want to delete this order?", "Orders")) { var selectedOrder = (IOrderInfo)View.SelectedOrder; _orderFactory.Delete(selectedOrder.Id); _dataBinder.BindUI(this); } }