/// <summary> /// Open the dialog /// </summary> private void Keyword_dialog_Open(object sender, RoutedEventArgs e) { // Set dataItem as current item ListViewItem currentItem = _listTable.GetParentListViewItem(e.OriginalSource as FrameworkElement); Oltp.KeywordRow row = currentItem.Content as Oltp.KeywordRow; // Show the dialog Keyword_dialog.Title = row.Keyword; Keyword_dialog.TitleTooltip = "GK #" + row.GK.ToString(); // Disable editing keyword value _keywordValueField.IsEnabled = false; Keyword_dialog.BeginEdit( Dialog_MakeEditVersion <Oltp.KeywordDataTable, Oltp.KeywordRow>(_keywords, row), row ); TabControl tabs = Visual.GetDescendant <TabControl>(Keyword_dialog); if (tabs.SelectedIndex == 1) { AssociationsTabItem_GotFocus(null, null); } // When opening, select it only if no more than one is already selected if (_listTable._listView.SelectedItems.Count < 2) { _listTable._listView.SelectedItems.Clear(); currentItem.IsSelected = true; } }
/*=========================*/ #endregion #region Keywords /*=========================*/ /// <summary> /// Add a gateway to an dataItem /// </summary> private void Keyword_AddClick(object sender, RoutedEventArgs e) { // Create an editable new row Oltp.KeywordRow editVersion = Dialog_MakeEditVersion <Oltp.KeywordDataTable, Oltp.KeywordRow>(_keywords, null); editVersion.AccountID = this.Window.CurrentAccount.ID; editVersion.IsMonitored = true; // Show the dialog Keyword_dialog.Title = "New Keyword"; // Enable editing keyword value _keywordValueField.IsEnabled = true; Keyword_dialog.BeginEdit(editVersion, _keywords); }
/// <summary> /// Open the dialog /// </summary> private void Keyword_dialog_Open(object sender, RoutedEventArgs e) { // Set dataItem as current item ListViewItem currentItem = _listTable.GetParentListViewItem(e.OriginalSource as FrameworkElement); Oltp.KeywordRow row = currentItem.Content as Oltp.KeywordRow; // Show the dialog Keyword_dialog.Title = row.Keyword; Keyword_dialog.TitleTooltip = "GK #" + row.GK.ToString(); // Disable editing keyword value if (_keywordValueField != null) { _keywordValueField.IsEnabled = false; } Keyword_dialog.BeginEdit( Dialog_MakeEditVersion <Oltp.KeywordDataTable, Oltp.KeywordRow>(row), row ); }