Beispiel #1
0
        private void UpdateApplicationColor()
        {
            if (this.settings == null)
            {
                throw new InvalidOperationException("Settings not initialized.");
            }

            ApplicationColor accentColor = this.settings.AccentColor;

            if (accentColor != EmulatorComponent.ApplicationColor.Accent)
            {
                (Resources["AccentBrush"] as SolidColorBrush).Color = this.originalAccentColor;

                object accentBrushTmp = null;
                var    resourceKey    = accentColor.ToString() + "Brush";
                if (!this.Resources.TryGetValue(resourceKey, out accentBrushTmp))
                {
                    return;
                }
                SolidColorBrush accentBrush = accentBrushTmp as SolidColorBrush;
                if (accentBrush == null)
                {
                    return;
                }

                this.Resources["SystemAccentColor"] = accentBrush.Color;
            }
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            ApplicationColor src = (ApplicationColor)value;

            return((int)src);
        }