Beispiel #1
0
        public override bool TryGetValue(IEnumerable <IMvxSourceStep> steps, out object value)
        {
            var sourceStep = steps.First();
            var parameter  = GetParameterValue(steps);

            object sourceValue = sourceStep.GetValue();

            if (sourceValue == MvxBindingConstant.DoNothing)
            {
                value = MvxBindingConstant.DoNothing;
                return(true);
            }

            if (sourceValue == MvxBindingConstant.UnsetValue)
            {
                value = MvxBindingConstant.UnsetValue;
                return(true);
            }

            if (_valueConverter == null)
            {
                value = MvxBindingConstant.UnsetValue;
                return(true);
            }

            value = _valueConverter.Convert(sourceValue, _targetType, parameter, CultureInfo.CurrentUICulture);
            return(true);
        }
        public virtual object Convert(object value, Type targetType, object parameter, string language)
        {
            // note - Language ignored here!
            var toReturn = _wrapped.Convert(value, targetType, parameter, CultureInfo.CurrentUICulture);

            return(MapIfSpecialValue(toReturn));
        }
Beispiel #3
0
            private string GetGroupHeader(BaseSessionListViewModel <TKeyType> .SessionGroup group)
            {
                if (_keyConverter == null)
                {
                    return(group.Key.ToString());
                }

                return((string)_keyConverter.Convert(group.Key, typeof(string), null, CultureInfo.CurrentUICulture));
            }
Beispiel #4
0
            private string KeyToString(TKey key)
            {
                if (_keyConverter == null)
                {
                    return(key.ToString());
                }

                return((string)_keyConverter.Convert(key, typeof(string), null, CultureInfo.CurrentUICulture));
            }
        public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var toReturn = _wrapped.Convert(value, targetType, parameter, culture);

            return(MapIfSpecialValue(toReturn));
        }
Beispiel #6
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(_wrapped.Convert(value, targetType, parameter, culture));
 }