private void TextBox_Value_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { switch (e.Key) { case System.Windows.Input.Key.Enter: case System.Windows.Input.Key.Escape: { var be = TextBox_Value.GetBindingExpression(TextBox.TextProperty); be.UpdateSource(); } break; } }
private void WindowBase_Loaded(object sender, RoutedEventArgs e) { if (TextBox_Value != null) { var bindExp = TextBox_Value.GetBindingExpression(TextBox.TextProperty); if (bindExp != null) { if (bindExp.ParentBinding.ValidationRules.Count > 0) { var rule = bindExp.ParentBinding.ValidationRules[0] as InputWindow.RequiredRule; if (rule != null) { rule.OnValidateCheck = mOnValidateCheck; } } } } }
private void userControl_Loaded(object sender, RoutedEventArgs e) { var icc = BindInstance as InputWindow.IInputErrorCheckClass; if (TextBox_Value != null && icc != null) { var bindExp = TextBox_Value.GetBindingExpression(TextBox.TextProperty); if (bindExp != null) { if (bindExp.ParentBinding.ValidationRules.Count > 0) { var rule = bindExp.ParentBinding.ValidationRules[0] as InputWindow.RequiredRule; if (rule != null) { rule.OnValidateCheck = icc.IsInputValidate; } } } } }
void InputWindow_Loaded(object sender, RoutedEventArgs e) { if (TextBox_Value != null) { var bindExp = TextBox_Value.GetBindingExpression(TextBox.TextProperty); if (bindExp != null) { if (bindExp.ParentBinding.ValidationRules.Count > 0) { var rule = bindExp.ParentBinding.ValidationRules[0] as RequiredRule; if (rule != null) { rule.OnValidateCheck = mOnValidateCheck; } } } } mWinEffects.Clear(); foreach (var win in DockControl.DockManager.Instance.DockableWindows) { mWinEffects[win] = Effect; win.Effect = new BlurEffect() { Radius = 2, KernelType = KernelType.Gaussian }; } if (OwnerControl != null) { var oriPt = OwnerControl.PointToScreen(new Point(0, 0)); this.Left = oriPt.X + OwnerControl.ActualWidth * 0.5 - this.ActualWidth * 0.5; this.Top = oriPt.Y + OwnerControl.ActualHeight * 0.5 - this.ActualHeight * 0.5; } }
private void TextBox_Value_LostFocus(object sender, RoutedEventArgs e) { var be = TextBox_Value.GetBindingExpression(TextBox.TextProperty); be.UpdateSource(); }