/// <summary> /// Bind the saved theme from settings to the root element which cascadingly applies to children elements /// the reason this is bound in code behind is that because viewmodels are loaded after the pages, /// resulting to a nullreference exception if bound in xaml. /// </summary> private void SetColor() { // We have to create a own local settings object here since the general dependency // registration takes place later and the Theme can only be set in the constructor. RequestedTheme = new WindowsCommonSettings().GetValue(SettingsManager.DARK_THEME_SELECTED_KEYNAME, false) ? ApplicationTheme.Dark : ApplicationTheme.Light; }
/// <summary> /// Bind the saved theme from settings to the root element which cascadingly applies to children elements /// the reason this is bound in code behind is that because viewmodels are loaded after the pages, /// resulting to a nullreference exception if bound in xaml. /// </summary> private void SetColor() { // We have to create a own local settings object here since the general dependency // registration takes place later and the Theme can only be set in the constructor. RequestedTheme = new WindowsCommonSettings().GetValue(SettingsHelper.DARK_THEME_SELECTED, false) ? ApplicationTheme.Dark : ApplicationTheme.Light; }
public void GetValues_HasValue_ReturnValue() { var key = "Foo"; var value = "abcd"; var settings = new WindowsCommonSettings(); settings.AddOrUpdateValue(key, value); Assert.AreEqual(value, settings.GetValue(key, "123")); }
public void Ctor() { var settings = new WindowsCommonSettings(); Assert.IsNotNull(settings); }