Add template project

This commit is contained in:
2026-02-27 12:17:48 -05:00
parent e2236ddc16
commit de3f6c2e98
29 changed files with 2110 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Windows;
using ChrisKaczor.Wpf.Validation;
namespace Template.SettingsWindow;
public partial class ItemWindow
{
public ItemWindow()
{
InitializeComponent();
}
public bool? Display(ItemEntry itemEntry, Window owner)
{
DataContext = itemEntry;
Title = string.IsNullOrWhiteSpace(itemEntry.Name) ? Properties.Resources.ItemWindowAdd : Properties.Resources.ItemWindowEdit;
Owner = owner;
return ShowDialog();
}
private void HandleOkayButtonClick(object sender, RoutedEventArgs e)
{
if (!this.IsValid())
return;
var item = (ItemEntry)DataContext;
if (!Data.ItemEntries.Contains(item))
Data.ItemEntries.Add(item);
Data.Save();
DialogResult = true;
Close();
}
}