Esempio n. 1
0
        protected override void WriteKeys(Newtonsoft.Json.JsonWriter writer)
        {
            if (DateStyle != FieldDateTimeStyle.Unspecified)
            {
                writer.WritePropertyName("dateStyle");
                writer.WriteValue(DateStyle.ToString());
            }

            if (TimeStyle != FieldDateTimeStyle.Unspecified)
            {
                writer.WritePropertyName("timeStyle");
                writer.WriteValue(TimeStyle.ToString());
            }

            if (IsRelative.HasValue)
            {
                writer.WritePropertyName("isRelative");
                writer.WriteValue(IsRelative.Value);
            }

            if (IgnoresTimeZone.HasValue)
            {
                writer.WritePropertyName("ignoresTimeZone");
                writer.WriteValue(IgnoresTimeZone.Value);
            }
        }
Esempio n. 2
0
        public Appearance()
        {
            InitializeComponent();

            List <string> _themeval = new List <string>();

            _themeval.Add("SystemTheme".GetLocalized());
            _themeval.Add("LightTheme".GetLocalized());
            _themeval.Add("DarkTheme".GetLocalized());
            ThemeChooser.ItemsSource = _themeval;

            ThemeChooser.SelectedIndex = (int)Enum.Parse(typeof(ElementTheme), ThemeHelper.RootTheme.ToString());
            ThemeChooser.Loaded       += (s, e) =>
            {
                ThemeChooser.SelectionChanged += (s1, e1) =>
                {
                    var themeComboBox = s1 as ComboBox;

                    switch (themeComboBox.SelectedIndex)
                    {
                    case 0:
                        ThemeHelper.RootTheme = ElementTheme.Default;
                        break;

                    case 1:
                        ThemeHelper.RootTheme = ElementTheme.Light;
                        break;

                    case 2:
                        ThemeHelper.RootTheme = ElementTheme.Dark;
                        break;
                    }
                };
            };

            //Load App Time Style
            List <string> _dateformatval = new List <string>();

            _dateformatval.Add("ApplicationTimeStye".GetLocalized());
            _dateformatval.Add("SystemTimeStye".GetLocalized());
            DateFormatChooser.ItemsSource = _dateformatval;

            TimeStyle _selectedFormat = AppSettings.DisplayedTimeStyle;

            DateFormatChooser.SelectedIndex = (int)Enum.Parse(typeof(TimeStyle), _selectedFormat.ToString());
            DateFormatChooser.Loaded       += (s, e) =>
            {
                DateFormatChooser.SelectionChanged += (s1, e1) =>
                {
                    var timeStyleComboBox = s1 as ComboBox;

                    switch (timeStyleComboBox.SelectedIndex)
                    {
                    case 0:
                        AppSettings.DisplayedTimeStyle = TimeStyle.Application;
                        break;

                    case 1:
                        AppSettings.DisplayedTimeStyle = TimeStyle.System;
                        break;
                    }

                    //await TimeFormatReminder.Fade(value: 1.0f, duration: 1500, delay: 0).StartAsync();
                    //await TimeFormatReminder.Fade(value: 0.0f, duration: 1500, delay: 0).StartAsync();
                };
            };
        }