Refactor Zune SettingsView to remove ViewModel
Arlodotexe opened this issue · comments
Arlo commented
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 theSettingsView
control. - Use the
ZuneDesktopSettings
directly. This uses OwlCore'sSettingsBase
, 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, callSaveAsync()
on ZuneDesktopSettings - In the
CancelClicked
event handler, call theLoadAsync()
method on ZuneDesktopSettings to reload the persisted values into memory and overwrite unsaved changes.