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()));; }
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); }
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); }