예제 #1
0
        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);
            }
        }
예제 #2
0
 private void SplitButton_Click(object sender, RoutedEventArgs e)
 {
     CountRequested?.Invoke(this, new IntEventArgs()
     {
         Value = 1
     });
     TogglePopup(false);
 }
예제 #3
0
        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);
        }