private static void IsFocusedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var fe = (FrameworkElement)d; if (e.OldValue == null) { fe.GotFocus += FrameworkElement_GotFocus; fe.LostFocus += FrameworkElement_LostFocus; } if (!fe.IsVisible) { fe.IsVisibleChanged += new DependencyPropertyChangedEventHandler(fe_IsVisibleChanged); } if ((bool)e.NewValue) { ProcessDesigner.UserControls.ComboBoxCus combo = fe as ProcessDesigner.UserControls.ComboBoxCus; ProcessDesigner.UserControls.ComboBoxWithSearch combosearch = fe as ProcessDesigner.UserControls.ComboBoxWithSearch; ProcessDesigner.UserControls.DatePickerCus datepic = fe as ProcessDesigner.UserControls.DatePickerCus; if (combo != null) { ((System.Windows.Controls.TextBox)combo.FindName("txtCombobox")).Focus(); } else if (combosearch != null) { ((System.Windows.Controls.TextBox)combosearch.FindName("txtCombobox")).Focus(); } else if (datepic != null) { ((System.Windows.Controls.TextBox)datepic.FindName("txtDate")).Focus(); } else { fe.Focus(); } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ucComboBox = ((ProcessDesigner.UserControls.ComboBoxCus)(target)); #line 8 "..\..\ComboBoxCus.xaml" this.ucComboBox.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.ucComboBox_PreviewKeyDown); #line default #line hidden return; case 2: this.ErrorTemp = ((System.Windows.Controls.Canvas)(target)); return; case 3: this.txtCombobox = ((System.Windows.Controls.TextBox)(target)); #line 21 "..\..\ComboBoxCus.xaml" this.txtCombobox.LostFocus += new System.Windows.RoutedEventHandler(this.txtCombobox_LostFocus); #line default #line hidden #line 21 "..\..\ComboBoxCus.xaml" this.txtCombobox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.txtCombobox_PreviewTextInput); #line default #line hidden #line 23 "..\..\ComboBoxCus.xaml" this.txtCombobox.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.txtCombobox_MouseDoubleClick); #line default #line hidden return; case 4: this.TogCombobox = ((System.Windows.Controls.Primitives.ToggleButton)(target)); return; case 5: this.popContent = ((System.Windows.Controls.Primitives.Popup)(target)); #line 28 "..\..\ComboBoxCus.xaml" this.popContent.KeyUp += new System.Windows.Input.KeyEventHandler(this.Popup_KeyUp); #line default #line hidden #line 28 "..\..\ComboBoxCus.xaml" this.popContent.Closed += new System.EventHandler(this.Popup_Closed); #line default #line hidden #line 28 "..\..\ComboBoxCus.xaml" this.popContent.Opened += new System.EventHandler(this.popContent_Opened); #line default #line hidden return; case 6: this.bdrContent = ((System.Windows.Controls.Border)(target)); return; case 7: this.grdLookUp = ((System.Windows.Controls.Grid)(target)); return; case 8: this.cmbSearchIn = ((System.Windows.Controls.ComboBox)(target)); #line 53 "..\..\ComboBoxCus.xaml" this.cmbSearchIn.DropDownClosed += new System.EventHandler(this.cmbSearchIn_DropDownClosed); #line default #line hidden return; case 9: this.txtSearchValue = ((System.Windows.Controls.TextBox)(target)); #line 55 "..\..\ComboBoxCus.xaml" this.txtSearchValue.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtSearchValue_TextChanged); #line default #line hidden return; case 10: this.cmbStatus = ((System.Windows.Controls.ComboBox)(target)); #line 68 "..\..\ComboBoxCus.xaml" this.cmbStatus.DropDownClosed += new System.EventHandler(this.cmbStatus_DropDownClosed); #line default #line hidden return; case 11: this.dgLookup = ((System.Windows.Controls.DataGrid)(target)); #line 75 "..\..\ComboBoxCus.xaml" this.dgLookup.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.dgLookup_MouseDoubleClick); #line default #line hidden #line 78 "..\..\ComboBoxCus.xaml" this.dgLookup.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.dgLookup_PreviewMouseLeftButtonDown); #line default #line hidden #line 78 "..\..\ComboBoxCus.xaml" this.dgLookup.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgLookup_SelectionChanged); #line default #line hidden return; } this._contentLoaded = true; }