/// <summary> /// Reset settings object to default values. /// </summary> /// <typeparam name="T">The type of the settings object.</typeparam> /// <param name="settings">The settings object to reset.</param> public static void ResetDefault <T>(T settings) where T : INotifyPropertyChanged, new() { var context = new Resetter(settings); settings.Serialize(context); }
public override void SerializeChild(string name) { var property = GetProperty(name); var child = (INotifyPropertyChanged)property.GetValue(Settings); if (child == null) { child = CreateChildValue(property); } var childContext = new Resetter(child); child.Serialize(childContext); SetPropertyValue(name, child); }