mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
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:
@@ -20,7 +20,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
|||||||
// converts the current to a json string.
|
// converts the current to a json string.
|
||||||
public virtual string ToJsonString()
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user