Exemple #1
0
        private void GoToEditEmployeeWindow(object sender, RoutedEventArgs e)
        {
            Employee           Employee           = ((FrameworkElement)sender).DataContext as Employee;
            EditEmployeeWindow editEmployeeWindow = new EditEmployeeWindow(Employee);

            SwitchWindows(editEmployeeWindow);
        }
        private void AddEmployee_ButtonClicked(object sender, RoutedEventArgs e)
        {
            var childWindow = new EditEmployeeWindow(Client, new User())
            {
                Owner = this
            };

            childWindow.Closed += new EventHandler(EditEmployeeWindow_Closed);
            childWindow.Show();
        }
        private void EditEmployee_ButtonClicked(object sender, RoutedEventArgs e)
        {
            var selectedItem = EmployeeGrid.SelectedItem as User;
            var childWindow  = new EditEmployeeWindow(Client, selectedItem)
            {
                Owner = this
            };

            childWindow.Closed += new EventHandler(EditEmployeeWindow_Closed);
            childWindow.Show();
        }