示例#1
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);
        }
示例#2
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()));;
        }