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
alinateghi opened this issue Nov 2, 2016 · 1 comment
Closed

NumericUpDown Parent Click Event #2732

alinateghi opened this issue Nov 2, 2016 · 1 comment

Comments

@alinateghi
Copy link

@alinateghi alinateghi commented Nov 2, 2016

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 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 Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.