private void RadarMaxFrameRateTextBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox textbox = sender as TextBox; byte value; if (!byte.TryParse(textbox.Text, out value)) { textbox.Text = 30.ToString(CultureInfo.CurrentCulture); return; } if (value > 144) { textbox.Text = 144.ToString(CultureInfo.CurrentCulture); } else if (value < 1) { textbox.Text = 1.ToString(CultureInfo.CurrentCulture); } RadarOverlay radarOverlay = this.ro; if (radarOverlay == null) { return; } radarOverlay.SetNewFrameRate(); }
private void RadarMaxFrameRateTextBox_TextChanged(object sender, TextChangedEventArgs e) { var textbox = sender as TextBox; if (byte.TryParse(textbox.Text, out byte value)) { if (value > 144) { textbox.Text = 144.ToString(); } else if (value < 1) { textbox.Text = 1.ToString(); } ro?.SetNewFrameRate(); } else { textbox.Text = 30.ToString(); } }