Owner decision pending (STATE.md DC-100 tick): adopt/ship/park. Preserved from fragile git stash to named branch 2026-08-23. NOTE: requires a Windows build machine (WinUI XAML compiler + MSIX do not cross-build on Linux) — see WINDOWS_APP_BUILD.md in this tree. Secret-scanned clean 2026-08-23 (no keys/tokens/PEM in tree).
33 lines
903 B
C#
33 lines
903 B
C#
using Microsoft.UI.Xaml;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using DashCaddy.Desktop.ViewModels;
|
|
using DashCaddy.Desktop.Services;
|
|
|
|
namespace DashCaddy.Desktop;
|
|
|
|
public sealed partial class TemplatesDialog : ContentDialog
|
|
{
|
|
public MainViewModel ViewModel { get; }
|
|
|
|
public TemplatesDialog(MainViewModel viewModel)
|
|
{
|
|
ViewModel = viewModel;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void AddTemplate_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button btn && btn.Tag is ServiceTemplate template)
|
|
{
|
|
var variables = new Dictionary<string, string>();
|
|
foreach (var (key, value) in template.Environment)
|
|
{
|
|
variables[key] = value;
|
|
}
|
|
|
|
ViewModel.SelectedTemplate = template;
|
|
ViewModel.TemplateVariablesDict = variables;
|
|
Hide();
|
|
}
|
|
}
|
|
} |