/// <summary> /// if update mode load directory object from db /// </summary> private void Window_Loaded(object sender, RoutedEventArgs e) { if (mode == WindowMode.Update) { _dir = DirectoryController.Select(_dir.pk); if (_dir != null) { txtDirName.Text = _dir.name; txtDirDescr.Text = _dir.description; foreach (ComboBoxItem ci in cmbLabel.Items) { if (ci.Background.ToString() == _dir.color) { cmbLabel.SelectedItem = ci; } } } else { this.DialogResult = false; } } }