Beispiel #1
0
        //sets a skin as the current skin
        public void setCurrentSkin(Skin skin)
        {
            SkinObject.GetInstance().CurrentSkin = skin;

            /*
             * BitmapImage img = new BitmapImage();
             * img.BeginInit();
             * img.UriSource = new Uri(skin.Background);
             * img.EndInit();
             * */

            foreach (KeyValuePair <string, object> property in this.CurrentSkin.Properties)
            {
                App.Current.Resources[property.Key] = property.Value;
            }

            /*
             * App.Current.Resources["BackgroundImage"] = img;
             *
             * App.Current.Resources["<LinearGradientBrush StartPoint="0,0" EndPoint="0,1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"><LinearGradientBrush.GradientStops><GradientStop Color="#FFFFD700" Offset="0.2" /><GradientStop Color="#FFFFFF00" Offset="0.85" /><GradientStop Color="#FFFFD700" Offset="1" /></LinearGradientBrush.GradientStops></LinearGradientBrush>"] = this.CurrentSkin.HeaderBackgroundColor2;
             * App.Current.Resources["HeaderBackgroundBrush"] = this.CurrentSkin.HeaderBackgroundColor1;
             * App.Current.Resources["ButtonBrush"] = this.CurrentSkin.ButtonBrush;
             * */
        }
Beispiel #2
0
 // loads all available Skins and makes the first the default
 public static void Init()
 {
     LoadAvailableSkins();
     SkinObject.GetInstance().setCurrentSkin(Skins.GetSkins()[Skins.GetSkins().Count - 1]);
 }