private void DoubleUpDown_LostFocus(object sender, RoutedEventArgs e) { Xceed.Wpf.Toolkit.DoubleUpDown dud = (Xceed.Wpf.Toolkit.DoubleUpDown)sender; if (string.IsNullOrEmpty(dud.Text)) { dud.Value = dud.DefaultValue; dud.Text = 0.ToString("C2", new System.Globalization.CultureInfo("es-UY")); } }
private static void SetDecimalPlaces(Xceed.Wpf.Toolkit.DoubleUpDown doubleUpDown, int decimalPlaces) { if (doubleUpDown == null) { throw new NullReferenceException("DoubleUpDoun is NULL"); } if (decimalPlaces == 0) { throw new Exception("decimal places must be > 0"); } doubleUpDown.FormatString = "F" + decimalPlaces.ToString(); }