Arlodotexe / strix-music

Combine any music sources into a single library. It's your music. Play it your way.

Home Page:http://www.strixmusic.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor Zune SettingsView to remove ViewModel

Arlodotexe opened this issue · comments

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 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.