private void createAddCustomerDialog() { loadCustomerWindow = new LoadCustomer { DataContext = new LoadCustomerVM(CustomerEvents) }; loadCustomerWindow.Closing += (o, e) => { usersFromDB = DBConnector.GetFromDB(string.Format(DB_StoredProcedures.CUSTOMER_GET, string.Empty, string.Empty, string.Empty, string.Empty)); CustomerList = null; CustomerList = usersFromDB.Copy(); }; loadCustomerWindow.Show(); }
private void AddNewCustomer(object obj) { if (loadCustomerWindow == null) { createAddCustomerDialog(); } else { if (loadCustomerWindow.IsLoaded.Equals(false)) { loadCustomerWindow = null; createAddCustomerDialog(); } else { loadCustomerWindow.Focus(); } } }