Hello,
I use xamMaskedInput bind a model's property which type is "int?",when i fill a vaild value to xamMaskedInput, then clear it. I found my action didn't raise a propertychanged event, also the tooltip have a error: value "" could not be converted.
Anyone have idea about this case?
xaml code:
<igDP:XamMaskedInput x:Name="msiCAI" Grid.Column="1" Text="{Binding Path=CAI, UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}" Mask="{}{char:3:0-9}"> <igDP:XamMaskedInput.ValueConstraint> <igDP:ValueConstraint Nullable="True"/> </igDP:XamMaskedInput.ValueConstraint> </igDP:XamMaskedInput>
Thanks,
Hello Brandon,
Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
Thanks for your reply.
But it doesn't resolve my issue.
And I have resolve this issue by a converter. Anyway thank you again.
code:
public class EmptyStringToNullValueConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value; }
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value.ToString() == string.Empty ? null : value; } }
xaml:
<controls:RMMaskedInput x:Name="msiPCRCAI" Grid.Column="1" Text="{Binding Path=CAI, UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,Converter={StaticResource EmptyStringToNullValueConverter}}" Mask="{}{char:3:0-9}"/>