Exemple #1
0
 private void AddGroupButton_Click(object sender, RoutedEventArgs e)
 {
     NewGroupStackPanel.Visibility   = Visibility.Visible;
     ShowWorkersViewButton.IsEnabled = false;
     NewGroupNameTextBox.Text        = string.Empty;
     NewGroupNameTextBox.Focus();
 }
Exemple #2
0
        private void OKAddGroupButton_Click(object sender, RoutedEventArgs e)
        {
            if (NewGroupNameTextBox.Text.Trim() == string.Empty)
            {
                NewGroupNameTextBox.Focus();
                return;
            }

            if (!BindingOperations.IsDataBound(NewGroupNameTextBox, TextBox.TextProperty))
            {
                _mwc.AddMyWorkersGroup(AdministrationClass.CurrentWorkerId, NewGroupNameTextBox.Text.Trim());
            }
            else
            {
                _mwc.SaveMyWorkers();
            }

            MyWorkersGroupComboBox.SelectedIndex = 0;

            CancelAddGroupButton_Click(null, null);
        }
Exemple #3
0
        private void EditGroupButton_Click(object sender, RoutedEventArgs e)
        {
            if (MyWorkersGroupComboBox.Items.Count == 0)
            {
                return;
            }
            if (MyWorkersGroupComboBox.SelectedItem == null)
            {
                return;
            }

            NewGroupStackPanel.Visibility   = Visibility.Visible;
            ShowWorkersViewButton.IsEnabled = false;
            NewGroupNameTextBox.Text        = string.Empty;
            NewGroupNameTextBox.Focus();

            var myBinding = new Binding("MyWorkerGroupName")
            {
                Mode = BindingMode.TwoWay
            };

            NewGroupNameTextBox.SetBinding(TextBox.TextProperty, myBinding);
            NewGroupNameTextBox.DataContext = MyWorkersGroupComboBox.SelectedItem;
        }