Esempio n. 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            string colour = "LightGame";
            var    game   = (Game)value;

            if (game.Weight > 4)
            {
                colour = "HeavyGame";
            }
            else if (game.Weight > 3)
            {
                colour = "MediumGame";
            }
            else
            {
                colour = "LightGame";
            }

            return(ColourHelper.GetColour(colour + ColourHelper.CurrentThemeToString()));;
        }
Esempio n. 2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            var   game = (Game)value;
            Color c    = Color.Transparent;

            if (game.GameStatus == Status.Owned)
            {
                c = ColourHelper.GetColour("OffBackgroundColor" + ColourHelper.CurrentThemeToString());
            }
            else if (game.InCollection || game.UserRating > 0)
            {
                c = ColourHelper.GetColour("InCollectionColor");
            }
            else
            {
                return(Color.Transparent);
            }

            return(c);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            var game = (Game)value;

            try
            {
                string colour = string.Format("HasRating{0}Colour", Math.Floor(game.AverageRating));

                return(ColourHelper.GetColour(colour));
            }
            catch (Exception ex)
            { }
            return(Color.Transparent);
        }
Esempio n. 4
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            if ((double)value == 0)
            {
                return(Color.DarkGray);
            }

            try
            {
                string colour = string.Format("HasRating{0}Colour", Math.Floor((double)value));
                return(ColourHelper.GetColour(colour));
            }
            catch (Exception ex)
            { }
            return(Color.DarkGray);
        }