-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Should a click on a MetroTabItems close button really clear the buttons Command and CommandParameter properties? #2462
Comments
@lagwagon667 Just looked at this and think that we maybe doesn't need that. The fix is that we should check the CanExecute for false too and don't execute the code behind that. |
I don't think checking |
@lagwagon667 I don't know, it's old code, must look at this... |
@lagwagon667 I fix clearing the commands (I understood now why we does it). But a note, the commands on the MetroTabItem itself are not a good place for doing this what you want. It's better you use the Hope this helps! |
@lagwagon667 I put a refactoring note on my todo list for v2.0, cause I don't like what we do with this command closing stuff. |
@punker76 I just encountered this behaviour this week. Using the event is no solution when applying MVVM. However, I was able to work-around this by using the CloseTabCommand on MetroTabControl instead of the same parameter on MetroTabItem. You then still can use the CloseTabCommandParameter on the MetroTabItem. However, I do support @lagwagon667 on:
|
What steps will reproduce this issue?
Use
MetroTabControl
and addMetroTabItems
withCloseButtonEnabled
set totrue
andCloseTabCommand
(of theMetroTabItem
) bound to a command that triggers a dialog ("are you sure you want to close...blablabla?"). When denied, the command does not remove the tab, butcloseButton_Click
inMetroTabItem.cs
sets theCloseTabCommand
andCloseTabCommandParameter
properties to null, preventing subsequent command invocations.Expected outcome
In my opinion these two properties should remain set to their respective Command and Parameter or am I using this control not in the intended way?
Environment
The text was updated successfully, but these errors were encountered: