private void SpinnerTextBox_LostFocus(object sender, RoutedEventArgs e) { VOP.Controls.SpinnerControl spinnerCtl = sender as VOP.Controls.SpinnerControl; TextBox tb = spinnerCtl.Template.FindName("tbTextBox", spinnerCtl) as TextBox; int textValue = 0; if (!spinnerCtl.IsFocused) { if ("spinnerScaling" == spinnerCtl.Name) { if (int.TryParse(tb.Text, out textValue)) { if (textValue > 400) { tb.Text = "400"; } else if (textValue < 25) { tb.Text = "25"; } } else { tb.Text = "100"; } } } }
private void SpinnerTextBox_LostFocus(object sender, RoutedEventArgs e) { VOP.Controls.SpinnerControl spinnerCtl = sender as VOP.Controls.SpinnerControl; TextBox tb = spinnerCtl.Template.FindName("tbTextBox", spinnerCtl) as TextBox; int textValue = 0; if (!spinnerCtl.IsFocused) { if ("spinCtlBrightness" == spinnerCtl.Name || "spinCtlConstrast" == spinnerCtl.Name) { if (int.TryParse(tb.Text, out textValue)) { if (textValue > 100) { tb.Text = "100"; } else if (textValue <= 0) { tb.Text = "0"; } } else { tb.Text = "50"; } } } }
private void spinnerControl1_ValidationHasErrorChanged(object sender, RoutedPropertyChangedEventArgs <bool> e) { VOP.Controls.SpinnerControl sc = sender as VOP.Controls.SpinnerControl; if (false == common.IsOffline(m_currentStatus)) { if (sc.ValidationHasError == true) { btnApply.IsEnabled = false; } else { btnApply.IsEnabled = true; } } else { btnApply.IsEnabled = false; } }