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

SplitButton.IsEnabled based on Command.CanExecute? #745

Closed
MenzenJ opened this issue Sep 26, 2019 · 2 comments
Closed

SplitButton.IsEnabled based on Command.CanExecute? #745

MenzenJ opened this issue Sep 26, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@MenzenJ
Copy link

MenzenJ commented Sep 26, 2019

Hi,

is there a way to bind SplitButton.IsEnabled to the command.canExecute?
My goal is to disable the SplitButton completly if the button command cannot be executed.

I think if the internal ToggleButton would have a TwoWay-Binding for IsButtonEnabled it might work delegating IsButtonEnabled in the SplitButtonsStyle:
<fluent:SplitButton.Style>
<Style TargetType="fluent:SplitButton">
<Style.Triggers>
<Trigger Property="IsButtonEnabled" Value="False">
<Setter Property="IsEnabled" Value="False"/>
</Trigger>
</Style.Triggers>
</Style>
</fluent:SplitButton.Style>

But I don't know if that would have any side effects, and I'm not sure if I'm overlooking something really simple to achieve this behavior, hence the question.

Related:
#467 (This behavior was once integrated as default but got reverted)
#720


Environment

  • Fluent.Ribbon v7.0.0-alpha0661
  • Windows 10
  • .NET Framework 4.6.2
@batzen batzen self-assigned this Sep 26, 2019
@batzen batzen added this to the 7.0.0 milestone Sep 26, 2019
@batzen
Copy link
Member

batzen commented Sep 26, 2019

That's true. The binding of IsButtonEnabled on the internal ToggleButton should be two way.

@batzen batzen modified the milestones: 7.0.0, Next Sep 28, 2019
@batzen
Copy link
Member

batzen commented Sep 28, 2019

Will delay this for the next version as i absolutely want to get 7.0 released tomorrow.

batzen added a commit that referenced this issue Dec 1, 2019
@batzen batzen closed this as completed in 2d5bf70 Dec 1, 2019
batzen added a commit that referenced this issue Dec 1, 2019
Fixes #745 by binding IsButtonEnabled in two way mode
@batzen batzen modified the milestones: Future, 8.0.0 Apr 27, 2020
batzen added a commit that referenced this issue Dec 13, 2020
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