private void Btns_NewTimer_Click(object sender, RoutedEventArgs e) { var b = e.Source as Button; if (b?.Content == null) { CountRequested?.Invoke(this, new IntEventArgs() { Value = 1 }); TogglePopup(false); return; } if (int.TryParse(b.Content.ToString(), out int x)) { CountRequested?.Invoke(this, new IntEventArgs() { Value = x }); TogglePopup(false); } else { CountRequested?.Invoke(this, new IntEventArgs() { Value = 1 }); TogglePopup(false); } }
private void SplitButton_Click(object sender, RoutedEventArgs e) { CountRequested?.Invoke(this, new IntEventArgs() { Value = 1 }); TogglePopup(false); }
private void BtnCustom_Click(object sender, RoutedEventArgs e) { ApplyTemplate(); var o = (IntegerUpDown)Template.FindName("MyCustomIntegerUpDown", this); CountRequested?.Invoke(this, new IntEventArgs() { Value = o.Value.HasValue ? o.Value.Value : 1 }); TogglePopup(false); }