If I am serializing and later deserializing a class using DataContractSerializer how can I control the initial values of properties that were not serialized?
You can use a serialization callback. Add the following method to your Person class:
[OnDeserialized]
void OnDeserialized(StreamingContext context)
{
this.IsNew = true;
}
Another option is to remove the [DataContract] and [DataMember] attributes. In this case DCSerializer will call your constructor when it deserializes.