/// <summary> /// adds a new customer /// </summary> public void AddMethod() { addWin = new AddUpdateWindow(); Message addCust = new Message(); addCust.isAdd = true; Messenger.Default.Send(addCust); addWin.Show(); Messenger.Default.Register <NotificationMessage>(this, (msg) => { if (msg.Notification == "Close") { addWin.Close(); Messenger.Default.Register <Customer>(this, finish); } }); }
/// <summary> /// modifies a customer /// </summary> public void ModMethod() { modWin = new AddUpdateWindow(); Message modCust = new Message(); modCust.isAdd = false; //modCust.id = selectedCustomer.CustomerID; modCust.c = selectedCustomer; Messenger.Default.Send(modCust); modWin.Show(); Messenger.Default.Register <NotificationMessage>(this, (msg) => { if (msg.Notification == "Close") { modWin.Close(); Messenger.Default.Register <Customer>(this, finish); } }); }