Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumericUpDown Parent Click Event #2732

Closed
ali-nateghi opened this issue Nov 2, 2016 · 1 comment
Closed

NumericUpDown Parent Click Event #2732

ali-nateghi opened this issue Nov 2, 2016 · 1 comment

Comments

@ali-nateghi
Copy link

Hello

I used this control in a button. Button has click event so when i try to use up/down buttons, button event fired too. also when i touch other part this issue happen expected the textbox of it.

So, how can prevent parent event ?!

Thanks,
Ali

  • MahApps.Metro v1.3
@punker76
Copy link
Member

punker76 commented Nov 2, 2016

@alinateghi You can handle/prevent this at the Button's click event.

private async void ButtonClick(object sender, RoutedEventArgs e)
{
    if (e.OriginalSource != sender)
    {
        // do nothing if clicked NumericUpDown parts
        e.Handled = true;
    }
    else
    {
        // handle the button click action
        await this.ShowMessageAsync(string.Empty, "Yeah, you clicked the real button!");
    }
}

buttonclick2

@punker76 punker76 closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants