Is it possible to use a ressource to set the errormessage on a property convert error?
[Range(0, 10, ErrorMessageResourceName = "Error", ErrorMessageResourceType = typeof(Properties.Resources))]
[DataMember]
public int MyProperty
{
get; set;
}
The problem occourres if I try to set MyProperty to “aaa”. I get an error saying “Cannot convert ‘aaa'”. It is that message that I wish to customize.
I found a solution for my problem. I have created an extention for the controls I use in my XAML code (typically a TextBox). In the extention I handle the format exception and find the appropriate resource.