private static void IncrementChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { try { float newValue = (float)e.NewValue; SelectFloat item = sender as SelectFloat; TextBox tb = (TextBox)LogicalTreeHelper.FindLogicalNode(item, "txt"); string val = newValue.ToString("f3"); tb.Text = val; } catch { } }
private static void IncrementTextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { try { if (e.NewValue == null) { return; } SelectFloat item = sender as SelectFloat; item.Increment = Convert.ToSingle(e.NewValue); item.txt.Text = item.Increment.ToString("f3"); } catch { } }
private static void MaxValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { SelectFloat source = (SelectFloat)sender; source.txt_TextChanged(null, null); }