private void _numericUpDownYearTarget_TextChanged(object sender, TextChangedEventArgs e) { try { Convert.ToDouble(_numericUpDownYearTarget.Text); YearTargetValue = Convert.ToDouble(_numericUpDownYearTarget.Text); } catch (Exception) { _numericUpDownYearTarget.Text = YearTargetValue.ToString(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _numericUpDownMonthTarget.Text = MonthTargetValue.ToString(); _numericUpDownQuarterTarget.Text = QuarterTargetValue.ToString(); _numericUpDownYearTarget.Text = YearTargetValue.ToString(); _labelMonthTargetColor.Background = new SolidColorBrush(Color.FromArgb(MonthTargetColor.A, MonthTargetColor.R, MonthTargetColor.G, MonthTargetColor.B)); _labelQuarterTargetColor.Background = new SolidColorBrush(Color.FromArgb(QuarterTargetColor.A, QuarterTargetColor.R, QuarterTargetColor.G, QuarterTargetColor.B)); _labelYearTargetColor.Background = new SolidColorBrush(Color.FromArgb(YearTargetColor.A, YearTargetColor.R, YearTargetColor.G, YearTargetColor.B)); #if false this._checkBoxMonthTarget.IsChecked = MonthTargetVisibility; this._checkBoxQuarterTarget.IsChecked = QuarterTargetVisibility; this._checkBoxYearTarget.IsChecked = YearTargetVisibility; #endif }