コード例 #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var str  = value as string;
            var par  = 0;
            var pars = parameter as string;

            if (pars != null)
            {
                par = pars.TryInt();
            }
            return(ContentBase.GetResourcePath(str, par));
        }
コード例 #2
0
        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
        {
            var strings = value.OfType <string>();
            var image   = strings.FirstOrDefault(x => x != null);

            var par  = 0;
            var pars = parameter as string;

            if (pars != null)
            {
                par = pars.TryInt();
            }

            return(ContentBase.GetResourcePath(image, par));
        }