Files
Files copied to clipboard
Code Quality: Introduced view models to widgets
Summary
- [x] Introduced view models to widgets
- [x] Simplify the widget codebase
- [x] Replaced ICommands with RichCommands
- [x] EjectDrive
- [x] FormatDrive
- [x] Pin
- [x] Unpin
- [x] OpenInNewPane
- [x] OpenInNewTab
- [x] OpenInNewWindow
- [ ] OpenProperties
- [x] OpenFileLocation
- [x] RemoveRecentItem
- [x] ClearRecentItem
- [x] Make Refresh button at work
Details
C#:
- Moved code behind codes to newly created view models
- Removed a bunch of event handlers in Home page and let handle events in each widget
- Removed WidgetsHelper because it's now useless
- Removed duplicated codes and unified
- Replace ICommands with IRichCommands
XAML:
- No UI modifications
- Moved resources xaml out of HomePage and placed to newly created ResourceDictionary
PR Checklist
- [x] Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers. Closes #13210
- [x] Did you build the app and test your changes?
- [x] Did you check for accessibility? You can use Accessibility Insights for this.
- [ ] Did you remove any strings from the en-us resource file?
- [ ] Did you search the solution to see if the string is still being used?
- [ ] Did you implement any design changes to an existing feature?
- [ ] Was this change approved?
- [x] Are there any other steps that were used to validate these changes?
- Lanuch the app
- See the widgets shown correctly
- Right click an item
- See the context flyout shown correctly
- Add a new tab
- See the Home page loaded correctly
Tested locally ✅
- Are the ViewModels shared or does each tab have its own instance?
- Does this fix the issue where refreshing the home page doesn't update the drives?
Are the ViewModels shared or does each tab have its own instance?
@hishitetsu doesn't recommend. Can you clarify why this is need?
Does this fix the issue where refreshing the home page doesn't update the drives?
Yep, fixed.