Handle Settings in Windows App
I don't really like the dependencies on all that static stuff. It effectively means your code becomes very hard to test.

Also this code:


if (Windows.Storage.ApplicationData.Current.RoamingSettings.Values.ContainsKey("Theme"))
{
    int value = (int)Windows.Storage.ApplicationData.Current.RoamingSettings.Values["Theme"];
    if (value &gt;= 0 &amp;&amp; value &lt;= 2) { Theme = value; }
    else { Theme = 0; }
}
else { Theme = 0; }



seems repeated and should be consolidated into a single method.

I'd start cleaning it up by introducing an IThemeProvider which can be injected into your MainPage, MainPageVM and Settings classes. Would probably look like this:

class ThemeChangedEventArgs : EventArgs
{
    public readonly int NewTheme;

    public ThemeChangedEventArgs(int newTheme)
    {
        NewTheme = newTheme;
    }
}

interface IThemeProvider
{
    int GetCurrentTheme();
    void SetCurrentTheme(int theme);
    event EventHandler&lt;ThemeChangedEventArgs&gt; ThemeChanged;
}


Then your MainPage would look something like this:

private MainPageVM Data = new MainPageVM();
private IThemeProvider _ThemeProvider;

public MainPage(IThemeProvider themeProvider)
{
    _ThemeProvider = themeProvider;

    this.InitializeComponent();
    SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;

    this.DataContext = Data;

    this.SizeChanged += (s, args) =&gt; PageSizeChanged()
    _ThemeProvider.ThemeChanged += (s, e) =&gt; Data.Theme = e.NewTheme;
}


MainPageVM:

private IThemeProvider _ThemeProvider; 
public MainPageVM(IThemeProvider themeProvider)
{
    _ThemeProvider = themeProvider;
}

private void SetValues()
{
    Theme = _ThemeProvider.GetCurrentTheme();
}


and Settings:

private IThemeProvider _ThemeProvider; 
public Settings(IThemeProvider themeProvider)
{
    _ThemeProvider = themeProvider;
}

private void InitSettings()
{
    Theme.SelectedIndex = _ThemeProvider.GetCurrentTheme();
}

private void ThemeChanged(object sender, SelectionChangedEventArgs e)
{
    _ThemeProvider.SetCurrentTheme(Theme.SelectedIndex);
}


Code looks a lot cleaner now I'd say and you can easily mock the IThemeProvider out and test it.

Implementation of the provider could be like this (based on what you currently do):

public class ApplicationDataThemeProvider : IThemeProvider
{
    public ApplicationDataThemeProvider()
    {
        Windows.Storage.ApplicationData.Current.DataChanged += (a, o) =&gt;
        {
            CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =&gt;
            {
                OnThemeChanged((int)ApplicationData.Current.RoamingSettings.Values["Theme"]);
            });
        };
    }

    public int GetCurrentTheme()
    {
        if (Windows.Storage.ApplicationData.Current.RoamingSettings.Values.ContainsKey("Theme"))
        {
            int value = (int)Windows.Storage.ApplicationData.Current.RoamingSettings.Values["Theme"];
            return (value &gt;= 0 &amp;&amp; value &lt;= 2) ? value : 0;
        }
        return 0;
    }

    public void SetCurrentTheme(int theme)
    {
        ApplicationData.Current.RoamingSettings.Values["Theme"] = theme;
        ApplicationData.Current.SignalDataChanged();
    }

    public event EventHandler&lt;ThemeChangedEventArgs&gt; ThemeChanged;
    private void OnThemeChanged(int newTheme)
    {
        var handler = ThemeChanged;
        if (handler != null)
        {
            handler(this, new ThemeChangedEventArgs(newTheme));
        }
    }
}


This encapsulates all the nasty global app data stuff in a single class where it should be a lot easier to handle and debug.