Fix saving to JSON in PT Settings (#5197)

* Added argument to fix saving to JSON in PT Settings

* Added argument to fix saving to JSON in PT Settings
This commit is contained in:
Arjun Balgovind 2020-07-23 16:04:04 -07:00 committed by GitHub
parent b6e5a5e655
commit 47736603af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
// converts the current to a json string.
public virtual string ToJsonString()
{
return JsonSerializer.Serialize(this);
// By default JsonSerializer will only serialize the properties in the base class. This can be avoided by passing the object type (more details at https://stackoverflow.com/a/62498888)
return JsonSerializer.Serialize(this, this.GetType());
}
}
}