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

Refactor Zune SettingsView to remove ViewModel #125

Open
5 tasks
Arlodotexe opened this issue May 16, 2022 · 0 comments
Open
5 tasks

Refactor Zune SettingsView to remove ViewModel #125

Arlodotexe opened this issue May 16, 2022 · 0 comments
Labels
cleanup Messy code that could be cleaner refactor zune desktop shell

Comments

@Arlodotexe
Copy link
Owner

Overview

The Zune settings created very early in development, before we had a good handle on architecture. We've learned the hard way to just put View code in the control code-behind, instead of trying to put View code in a ViewModel.

What to do

In StrixMusic.Shells.ZuneDesktop.Controls.Views.Settings, the SettingsView is doing a couple of strange things that need to be cleaned up or removed:

  • Remove the dedicated ZuneDesktopSettingsViewModel and move code into the SettingsView control.
  • Use the ZuneDesktopSettings directly. This uses OwlCore's SettingsBase, which implements INPC for settings already, so we can just bind to the properties.
  • Remove the call to SaveAsync in property setters.
  • In the SaveClicked event handler, call SaveAsync() on ZuneDesktopSettings
  • In the CancelClicked event handler, call the LoadAsync() method on ZuneDesktopSettings to reload the persisted values into memory and overwrite unsaved changes.
@Arlodotexe Arlodotexe added zune desktop shell refactor cleanup Messy code that could be cleaner labels May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Messy code that could be cleaner refactor zune desktop shell
Projects
None yet
Development

No branches or pull requests

1 participant