void ShowWindowAddCustomer() // Wyświetlenie okna dialogowego do wprowadzenia nowego typu produktu { NewCustomerVM = new AddCustomerViewModel(); _addCustomerWindow = new AddCustomerWindow(); _addCustomerWindow.DataContext = NewCustomerVM; _addCustomerWindow.ShowDialog(); }
private void AddCustomerButton_Click(object sender, RoutedEventArgs e) { AddCustomerWindow wind = new AddCustomerWindow(); //Delegate for updating DataGrid after customer was added to Data Base wind.DataChanged += AddCustomerWindow_DataChanged; wind.ShowDialog(); }
void ShowWindowEditCustomer() // Wyświetlenie okna dialogowego do edycji typu produktu { if (SelectedCustomer != null) { NewCustomerVM = new AddCustomerViewModel(); NewCustomerVM.Client = SelectedCustomer; NewCustomerVM.IdVisible = Visibility.Visible; _addCustomerWindow = new AddCustomerWindow(); _addCustomerWindow.DataContext = NewCustomerVM; _addCustomerWindow.Title = "Edycja Klienta"; _addCustomerWindow.ShowDialog(); } }