What you are experiencing is all normal.
The issue I´m having is that when the TributaryCode is empty, I get an exception that says it cannot convert the value ''
If that really bothers you, you have a number of solutions; you could initialise the value with 0
; you could add a PreviewKeyDown
handler to only allow long
values; you could use a nullable long
:
public long? TributaryCode { get; set; }
when the window loads and loads the UserControl, all my empty TextBoxes have already the red border indicating that it didn´t pass the validation
Again, this is normal... what else did you expect to happen when the properties have no values? This is called predictive validation, where the user is warned about errors before they try to save. Personally, I prefer this system as the user always knows what they can and can't do.