Exemple #1
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            RoadState desiredState = StaticHelpers.ParseEnum <RoadState>((string)parameter);
            RoadState actualState  = (RoadState)value;

            if (actualState == desiredState)
            {
                return(Visibility.Visible);
            }
            return(Visibility.Collapsed);
        }
Exemple #2
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var tokens = (parameter as string).Split('|', StringSplitOptions.RemoveEmptyEntries);

            foreach (var e in tokens)
            {
                GameState desiredState = StaticHelpers.ParseEnum <GameState>(e);
                GameState actualState  = (GameState)value;
                if (actualState == desiredState)
                {
                    return(true);
                }
            }

            return(false);
        }