Hi John!
I need the formatting in all situations, except one: When the data is being stored in the database. At first, I tried the follwoing:
public override string TelephoneSF
{
get
{
return Phone.formatPhoneForDisplay(base.TelephoneSF);
}
set
{
base.TelephoneSF = Phone.formatPhoneForDB(value);
}
}
However, this did not work, since the method that is saving (inserting/updating) the entity in the database is also using the getter, so the data was getting formatted for display when it was actually being stored in the database. A major point that I had overseen.
For now, I decided to remove the formatting in the setter, and to add in the OnDatabinding method of the TextBoxes where the data is being displayed. I will consider Swin's approach though if I realize that this data needs to be displayed on various Forms.
Cheers!
JF