Esempio n. 1
0
 /// <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;
 }
Esempio n. 2
0
 /// <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"));
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
        public void Ctor()
        {
            var settings = new WindowsCommonSettings();

            Assert.IsNotNull(settings);
        }
 public void Ctor()
 {
     var settings = new WindowsCommonSettings();
     Assert.IsNotNull(settings);
 }