Example #1
0
        public static bool Compare(object sourceValue, object targetValue, ITriggerValueComparer comparer)
        {
            var actualComparer = comparer ?? XamlValueComparer.TriggerComparer;

            var actualSourceValue = sourceValue;
            var actualTargetValue = XamlStaticConverter.ConvertValue(targetValue, sourceValue?.GetType() ?? typeof(object));

            return(actualComparer.Compare(actualSourceValue, actualTargetValue));
        }
Example #2
0
        public object ProvideValue(object value, Type targetPropertyType)
        {
            if (targetPropertyType == _cacheTargetType)
            {
                return(_convertedCache);
            }

            _convertedCache  = XamlStaticConverter.ConvertValue(value, targetPropertyType);
            _cacheTargetType = targetPropertyType;

            return(_convertedCache);
        }
Example #3
0
 public static object XamlConvert(this object value, Type targetType)
 {
     return(XamlStaticConverter.ConvertValue(value, targetType));
 }