[New+]Support for variables in template filenames (#37074)

* Add variable support - initial version without UI

* Add variable in template filename support in New+

* Fix XAML style

* Addressed code review feedback
This commit is contained in:
Christian Gaarden Gaardmark
2025-03-18 04:52:51 -07:00
committed by GitHub
parent 1d358af600
commit 1f81d14000
28 changed files with 592 additions and 96 deletions

View File

@@ -18,6 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
HideFileExtension = new BoolProperty(true);
HideStartingDigits = new BoolProperty(true);
TemplateLocation = new StringProperty(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft", "PowerToys", "NewPlus", "Templates"));
ReplaceVariables = new BoolProperty(false);
}
[JsonPropertyName("HideFileExtension")]
@@ -29,6 +30,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[JsonPropertyName("TemplateLocation")]
public StringProperty TemplateLocation { get; set; }
[JsonPropertyName("ReplaceVariables")]
public BoolProperty ReplaceVariables { get; set; }
public override string ToString() => JsonSerializer.Serialize(this);
}
}