private void AddUser_Click(object sender, RoutedEventArgs e) { //pass to child like this: ChildWindow child= new ChildWindow("abc","somevalue"); UserWindow subWindow = new UserWindow("", "", "", "new"); subWindow.Owner = this; subWindow.passUserDetailsToParent += returnedCredManager => AddToDgUser(returnedCredManager); subWindow.Show(); }
private void btnModifyUser_Click(object sender, RoutedEventArgs e) { var selectedItem = dgUsers.SelectedItem; if (selectedItem != null) { var currentItem = dgUsers.SelectedItem as CredentialManager; UserWindow subWindow = new UserWindow(currentItem.userName, currentItem.userDomain, "", "edit"); subWindow.Owner = this; subWindow.passUserDetailsToParent += returnedCredManager => EditDgUser(returnedCredManager); subWindow.Show(); } }