-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from enisn/tabview-events
Add events to TabView
- Loading branch information
Showing
1 changed file
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8aba635
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If also possible to support Commands for MVVM, such as CurrentItemChangedCommand, SelectedTabChangedCommand.
8aba635
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, but in the ViewModel, SelectedItem setter is already triggered, and the change can be handled in the setter, or if you use Community Toolkit MVVM or ReactiveUI, you can easily handle the changes of a property.
But still, I'll consider to add commands, too. Thanks 🙏
8aba635
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for considering my suggestion 🙏 about supporting Commands for MVVM like CurrentItemChangedCommand and SelectedTabChangedCommand. I appreciate your point about handling changes directly in the ViewModel's SelectedItem setter.
While these methods are indeed effective for property change management, incorporating commands can offer additional benefits. Commands can provide a more explicit and declarative way of handling user interactions, making the intent clearer and the code more maintainable. They can also simplify the logic in the ViewModel, especially for more complex scenarios or when actions need to be triggered that go beyond just setting a property.
8aba635
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8666aa1