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

Type is mismatch for IsCheckedProperty of ToggleButton #166

Closed
nishy2000 opened this issue Sep 1, 2015 · 0 comments
Closed

Type is mismatch for IsCheckedProperty of ToggleButton #166

nishy2000 opened this issue Sep 1, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@nishy2000
Copy link
Contributor

Type of ToggleButton.IsCheckedProperty is 'bool?'.
But the type of value is treated as "bool" type in ToggleButtonHelper.CoerceIsChecked() and ToggleButtonHelper.OnIsCheckedChanged().

These functions is used in ToggleButton.cs

        static ToggleButton()
        {
            Type type = typeof(ToggleButton);
            DefaultStyleKeyProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(type));
            IsCheckedProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(ToggleButtonHelper.OnIsCheckedChanged, ToggleButtonHelper.CoerceIsChecked));
            ContextMenuService.Attach(type);
            ToolTipService.Attach(type);
            StyleProperty.OverrideMetadata(type, new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceStyle)));
        }
@batzen batzen added this to the Next milestone Sep 10, 2015
@batzen batzen self-assigned this Sep 10, 2015
@batzen batzen closed this as completed in 346d858 Sep 10, 2015
batzen added a commit that referenced this issue Sep 23, 2015
Fixes #166 by changing ToggleButtonHelper.OnIsCheckedChanged() so that it accepts type of "bool?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants