private void interval_ValueChanged(object sender, Syncfusion.UI.Xaml.Controls.Input.ValueChangedEventArgs e) { if (hubtile != null) { SfNumericUpDown _interval = sender as SfNumericUpDown; hubtile.Interval = TimeSpan.FromSeconds(Double.Parse(_interval.Value.ToString())); } }
private void pulseduration_Changed(object sender, Syncfusion.UI.Xaml.Controls.Input.ValueChangedEventArgs e) { if (hubtile != null) { SfNumericUpDown updown = sender as SfNumericUpDown; hubtile.PulseDuration = TimeSpan.FromSeconds(Double.Parse(pulseduration.Value.ToString())); } }
async void OnNumericClicked(object sender, EventArgs e) { SfNumericUpDown numeric = sender as SfNumericUpDown; Member oldMembre = numeric.BindingContext as Member; Member membre = KTContext.Db.Members.Find(oldMembre.Id); membre.Xp = oldMembre.Xp; membre.FleshWounds = oldMembre.FleshWounds; KTContext.Db.Entry(membre).State = EntityState.Modified; await KTContext.Db.SaveChangesAsync(); }
public View GetSampleContent(Context con) { int width = con.Resources.DisplayMetrics.WidthPixels - 40; float density = con.Resources.DisplayMetrics.Density; int numerHeight = (int)(density * 55); if (density >= 3) { numerHeight = (int)(density * 65); } SamplePageContent(con); //AdultNumericUpDown adultNumericUpDown = new SfNumericUpDown(con); adultNumericUpDown.FontSize = 18; adultNumericUpDown.TextGravity = GravityFlags.CenterVertical; adultNumericUpDown.LayoutParameters = new ViewGroup.LayoutParams(width, numerHeight); adultNumericUpDown.Minimum = 0; adultNumericUpDown.Maximum = 100; adultNumericUpDown.Value = 5; adultNumericUpDown.FormatString = "N"; adultNumericUpDown.AutoReverse = false; adultNumericUpDown.MaximumDecimalDigits = 0; adultNumericUpDown.StepValue = 1; //InfantsNumericUpDown infantsNumericUpDown = new SfNumericUpDown(con); infantsNumericUpDown.FontSize = 18; infantsNumericUpDown.TextGravity = GravityFlags.CenterVertical; infantsNumericUpDown.LayoutParameters = new ViewGroup.LayoutParams(width, numerHeight); infantsNumericUpDown.Minimum = 0; infantsNumericUpDown.Maximum = 100; infantsNumericUpDown.Value = 2; infantsNumericUpDown.FormatString = "N"; infantsNumericUpDown.AutoReverse = false; infantsNumericUpDown.MaximumDecimalDigits = 0; infantsNumericUpDown.StepValue = 1; //MainFrameLayout FrameLayout mainFrameLayout = new FrameLayout(con); mainFrameLayout.SetPadding(10, 10, 10, 10); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.FillVertical); mainFrameLayout.LayoutParameters = layoutParams; mainFrameLayout.AddView(GetView(con)); ScrollView mainScrollView = new ScrollView(con); mainScrollView.AddView(mainFrameLayout); return(mainScrollView); }
public override View GetSampleContent(Context con1) { con = con1; InitialMethod(); //adultNumericUpDown AdultLayout(); int numerHeight = (int)(density * 55); if (density >= 3) { numerHeight = (int)(density * 65); } adultNumericUpDown = new SfNumericUpDown(con); adultNumericUpDown.FontSize = 18; adultNumericUpDown.TextGravity = GravityFlags.CenterVertical; adultNumericUpDown.LayoutParameters = new ViewGroup.LayoutParams((int)(width * 0.7), numerHeight); adultNumericUpDown.Minimum = 0; adultNumericUpDown.Maximum = 100; adultNumericUpDown.Value = 5; adultNumericUpDown.FormatString = "N"; adultNumericUpDown.AutoReverse = false; adultNumericUpDown.MaximumDecimalDigits = 0; adultNumericUpDown.StepValue = 1; (adultNumericUpDown.GetChildAt(0) as EditText).FocusChange += adultNumericUpDown_Tab_FocusChange; mainLayout.AddView(adultNumericUpDown); //infantsNumericUpDown infantsTextLayout(); infantsNumericUpDown = new SfNumericUpDown(con); infantsNumericUpDown.FontSize = 18; infantsNumericUpDown.TextGravity = GravityFlags.CenterVertical; infantsNumericUpDown.LayoutParameters = new ViewGroup.LayoutParams((int)(width * 0.7), numerHeight); infantsNumericUpDown.Minimum = 0; infantsNumericUpDown.Maximum = 100; infantsNumericUpDown.Value = 2; infantsNumericUpDown.FormatString = "N"; infantsNumericUpDown.AutoReverse = false; infantsNumericUpDown.MaximumDecimalDigits = 0; infantsNumericUpDown.StepValue = 1; (infantsNumericUpDown.GetChildAt(0) as EditText).FocusChange += NumericUpDown_Tab_FocusChange; OptionLayout(); return(frame); }
public static bool TryValueFloat(this SfNumericUpDown control, out float value) { value = float.NaN; if (control.Value is string s) { if (float.TryParse(s, out float sf)) { value = sf; } else { return(false); } } else if (control.Value is decimal c) { value = (float)c; } else if (control.Value is double d) { value = (float)d; } else if (control.Value is float f) { value = f; } else if (control.Value is int i) { value = i; } else if (control.Value is null) { return(false); } else { throw new Exception("Unknown value type"); } return(true); }