Example #1
0
        public override void SetStringValue(PropertyItem <T> propertyItem, string value)
        {
            var xamlConvertResult = XamlStaticConverter.TryConvertValue(value, typeof(T));

            if (xamlConvertResult.IsValid)
            {
                propertyItem.Value = (T)xamlConvertResult.Result;
            }
            else
            {
                throw xamlConvertResult.Exception.InnerException ?? xamlConvertResult.Exception;
            }
        }
Example #2
0
        public override string GetStringValue(PropertyItem <T> propertyItem)
        {
            var xamlConvertResult = XamlStaticConverter.TryConvertValue(propertyItem.Value, typeof(string));

            return(xamlConvertResult.IsValid ? (string)xamlConvertResult.Result : string.Empty);
        }