void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mongoJsonEditorGrid = ((System.Windows.Controls.Grid)(target)); return; case 2: this.templateTabs = ((System.Windows.Controls.TabControl)(target)); return; case 3: this.EditCanvas = ((System.Windows.Controls.Canvas)(target)); return; case 4: this.Watermark = ((System.Windows.Controls.Label)(target)); return; case 5: this.textEditor = ((Twenty57.Linx.Components.Database.UI.Controls.MvvmTextEditor)(target)); return; } this._contentLoaded = true; }
private static void Editor_TextChanged(object sender, EventArgs e) { MvvmTextEditor editor = sender as MvvmTextEditor; if (editor != null) { SetBoundText(editor, editor.Text); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mainGrid = ((System.Windows.Controls.Grid)(target)); return; case 2: this.editorTestTabControl = ((System.Windows.Controls.TabControl)(target)); return; case 3: this.sqlGrid = ((System.Windows.Controls.Grid)(target)); return; case 4: this.sqlEditor = ((Twenty57.Linx.Components.Database.UI.Controls.MvvmTextEditor)(target)); return; case 5: this.testSqlPane = ((Twenty57.Linx.Components.Database.ExecuteSQL.Editors.SQLEditor.Helpers.TestSqlPaneScrollViewer)(target)); return; case 6: this.testGrid = ((System.Windows.Controls.Grid)(target)); return; case 7: this.parameterScrollViewer = ((System.Windows.Controls.ScrollViewer)(target)); return; case 8: this.SQLParametersList = ((System.Windows.Controls.ListView)(target)); return; case 10: this.resultsStackPanel = ((System.Windows.Controls.StackPanel)(target)); return; case 11: #line 373 "..\..\..\..\..\ExecuteSQL\Editors\SQLEditor\SQLEditor.xaml" ((System.Windows.Controls.DataGrid)(target)).AutoGeneratingColumn += new System.EventHandler <System.Windows.Controls.DataGridAutoGeneratingColumnEventArgs>(this.resultsDataGrid_AutoGeneratingColumn); #line default #line hidden return; } this._contentLoaded = true; }
private static void BoundTextChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { MvvmTextEditor editor = obj as MvvmTextEditor; if (editor != null) { if (e.OldValue == null && e.NewValue != null) { editor.TextChanged += Editor_TextChanged; } string newValue = (e.NewValue == null) ? String.Empty : (string)e.NewValue; if (newValue != editor.Text) { editor.Text = newValue; } } }
private static void BoundCaretOffsetChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { MvvmTextEditor editor = obj as MvvmTextEditor; if (editor != null) { if ((int)e.OldValue == defaultOffsetValue && (int)e.NewValue != defaultOffsetValue) { editor.TextArea.Caret.PositionChanged += Caret_PositionChanged; } if (!caretMappings.ContainsKey(editor.TextArea.Caret.GetHashCode())) { caretMappings.Add(editor.TextArea.Caret.GetHashCode(), editor); } int newValue = ((int)e.NewValue == defaultOffsetValue) ? default(int) : (int)e.NewValue; if (newValue != editor.CaretOffset) { editor.CaretOffset = newValue; } } }