diff --git a/FloatingStatusWindow.sln b/FloatingStatusWindow.sln
index 14f3e6f..f5ffbf0 100644
--- a/FloatingStatusWindow.sln
+++ b/FloatingStatusWindow.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.5.33530.505
+# Visual Studio Version 18
+VisualStudioVersion = 18.4.11519.219 insiders
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FloatingStatusWindow", "Library\FloatingStatusWindow.csproj", "{F023A16C-2F13-4A87-A8B7-22C43C4A58A4}"
EndProject
@@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{C4
README.md = README.md
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Template", "Template\Template.csproj", "{1F53FF5D-F943-1098-0F7F-B890BC359E46}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -39,6 +41,18 @@ Global
{0C541788-8FFD-47B6-8E6B-653A884CFA55}.Release|Any CPU.Build.0 = Release|Any CPU
{0C541788-8FFD-47B6-8E6B-653A884CFA55}.Release|x64.ActiveCfg = Release|Any CPU
{0C541788-8FFD-47B6-8E6B-653A884CFA55}.Release|x86.ActiveCfg = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|x64.Build.0 = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Debug|x86.Build.0 = Debug|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|x64.ActiveCfg = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|x64.Build.0 = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|x86.ActiveCfg = Release|Any CPU
+ {1F53FF5D-F943-1098-0F7F-B890BC359E46}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Template/.github/workflows/main.yml b/Template/.github/workflows/main.yml
new file mode 100644
index 0000000..515f367
--- /dev/null
+++ b/Template/.github/workflows/main.yml
@@ -0,0 +1,36 @@
+name: Deploy to GitHub Releases
+
+on:
+ push:
+ branches:
+ - main
+
+ workflow_dispatch:
+
+jobs:
+ deploy-to-github-releases:
+ runs-on: windows-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+
+ - name: Get next version
+ uses: reecetech/version-increment@2024.4.3
+ id: version
+ with:
+ scheme: calver
+
+ - name: Install .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 10.0.x
+
+ - name: Publish Application
+ run: dotnet publish Template.csproj -c Release -o publish
+
+ - name: Create Velopack Release
+ run: |
+ dotnet tool install -g vpk
+ vpk download github --repoUrl https://github.com/user/Template
+ vpk pack -u Template -v ${{ steps.version.outputs.version }} -p publish --packTitle "Template Status Window" --shortcuts StartMenuRoot --framework net10.0-x64-desktop
+ vpk upload github --repoUrl https://github.com/user/Template --publish --releaseName "${{ steps.version.outputs.version }}" --tag v${{ steps.version.outputs.version }} --token ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/Template/.gitignore b/Template/.gitignore
new file mode 100644
index 0000000..8a30d25
--- /dev/null
+++ b/Template/.gitignore
@@ -0,0 +1,398 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
diff --git a/Template/App.config b/Template/App.config
new file mode 100644
index 0000000..80dc6e5
--- /dev/null
+++ b/Template/App.config
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+
+
+ True
+
+
+ []
+
+
+
+
\ No newline at end of file
diff --git a/Template/App.xaml b/Template/App.xaml
new file mode 100644
index 0000000..0a3a050
--- /dev/null
+++ b/Template/App.xaml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/Template/App.xaml.cs b/Template/App.xaml.cs
new file mode 100644
index 0000000..c007d04
--- /dev/null
+++ b/Template/App.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Windows;
+using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
+using Template.Properties;
+
+namespace Template;
+
+public partial class App
+{
+ private List _windowSourceList;
+
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ base.OnStartup(e);
+
+ StartManager.ManageAutoStart = true;
+ StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
+ StartManager.AutoStartChanged += (value =>
+ {
+ Settings.Default.AutoStart = value;
+ Settings.Default.Save();
+ });
+
+ _windowSourceList =
+ [
+ new WindowSource()
+ ];
+ }
+
+ protected override void OnExit(ExitEventArgs e)
+ {
+ _windowSourceList.ForEach(ws => ws.Dispose());
+
+ base.OnExit(e);
+ }
+}
\ No newline at end of file
diff --git a/Template/Data.cs b/Template/Data.cs
new file mode 100644
index 0000000..f858271
--- /dev/null
+++ b/Template/Data.cs
@@ -0,0 +1,21 @@
+using System.Collections.ObjectModel;
+using System.Text.Json;
+using Template.Properties;
+
+namespace Template;
+
+internal static class Data
+{
+ internal static ObservableCollection ItemEntries { get; private set; }
+
+ internal static void Load()
+ {
+ ItemEntries = JsonSerializer.Deserialize>(Settings.Default.Items);
+ }
+
+ internal static void Save()
+ {
+ Settings.Default.Items = JsonSerializer.Serialize(ItemEntries);
+ Settings.Default.Save();
+ }
+}
\ No newline at end of file
diff --git a/Template/DataErrorDictionary.cs b/Template/DataErrorDictionary.cs
new file mode 100644
index 0000000..91beed4
--- /dev/null
+++ b/Template/DataErrorDictionary.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace Template;
+
+internal class DataErrorDictionary : Dictionary>
+{
+ public event EventHandler ErrorsChanged;
+
+ private void OnErrorsChanged(string propertyName)
+ {
+ ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
+ }
+
+ public IEnumerable GetErrors(string propertyName)
+ {
+ return TryGetValue(propertyName, out var value) ? value : null;
+ }
+
+ public void AddError(string propertyName, string error)
+ {
+ if (!ContainsKey(propertyName))
+ this[propertyName] = [];
+
+ if (this[propertyName].Contains(error))
+ return;
+
+ this[propertyName].Add(error);
+ OnErrorsChanged(propertyName);
+ }
+
+ public void ClearErrors(string propertyName)
+ {
+ if (!ContainsKey(propertyName))
+ return;
+
+ Remove(propertyName);
+ OnErrorsChanged(propertyName);
+ }
+}
\ No newline at end of file
diff --git a/Template/ItemEntry.cs b/Template/ItemEntry.cs
new file mode 100644
index 0000000..80895c2
--- /dev/null
+++ b/Template/ItemEntry.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Linq;
+using System.Text.Json.Serialization;
+
+namespace Template;
+
+public class ItemEntry : INotifyDataErrorInfo
+{
+ private readonly DataErrorDictionary _dataErrorDictionary;
+
+ public ItemEntry()
+ {
+ _dataErrorDictionary = new DataErrorDictionary();
+ _dataErrorDictionary.ErrorsChanged += DataErrorDictionaryErrorsChanged;
+ }
+
+ public string Name
+ {
+ get;
+ set
+ {
+ if (!ValidateName(value))
+ return;
+
+ field = value;
+ }
+ }
+
+ [JsonIgnore]
+ public bool HasErrors => _dataErrorDictionary.Any();
+
+
+ public IEnumerable GetErrors(string propertyName)
+ {
+ return _dataErrorDictionary.GetErrors(propertyName);
+ }
+
+ public event EventHandler ErrorsChanged;
+
+ private void DataErrorDictionaryErrorsChanged(object sender, DataErrorsChangedEventArgs e)
+ {
+ ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(e.PropertyName));
+ }
+
+ private bool ValidateName(string newValue)
+ {
+ _dataErrorDictionary.ClearErrors(nameof(Name));
+
+ if (!string.IsNullOrWhiteSpace(newValue))
+ return true;
+
+ _dataErrorDictionary.AddError(nameof(Name), "Name cannot be empty");
+
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/Template/Program.cs b/Template/Program.cs
new file mode 100644
index 0000000..11e3438
--- /dev/null
+++ b/Template/Program.cs
@@ -0,0 +1,27 @@
+using System;
+using Microsoft.Extensions.Logging;
+using Serilog;
+using Velopack;
+
+namespace Template;
+
+internal class Program
+{
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ Log.Logger = new LoggerConfiguration().WriteTo.File("log.txt").CreateLogger();
+
+ Log.Logger.Information("Start");
+
+ var loggerFactory = new LoggerFactory().AddSerilog(Log.Logger);
+
+ VelopackApp.Build().Run(loggerFactory.CreateLogger("Install"));
+
+ var app = new App();
+ app.InitializeComponent();
+ app.Run();
+
+ Log.Logger.Information("End");
+ }
+}
\ No newline at end of file
diff --git a/Template/Properties/Resources.Designer.cs b/Template/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..6db8a91
--- /dev/null
+++ b/Template/Properties/Resources.Designer.cs
@@ -0,0 +1,374 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Template.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Template.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Add.
+ ///
+ public static string AddItemLink {
+ get {
+ return ResourceManager.GetString("AddItemLink", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Add Item.
+ ///
+ public static string AddItemToolTip {
+ get {
+ return ResourceManager.GetString("AddItemToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ public static System.Drawing.Icon ApplicationIcon {
+ get {
+ object obj = ResourceManager.GetObject("ApplicationIcon", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Template Status Window.
+ ///
+ public static string ApplicationName {
+ get {
+ return ResourceManager.GetString("ApplicationName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Cancel.
+ ///
+ public static string CancelButton {
+ get {
+ return ResourceManager.GetString("CancelButton", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Checking for update....
+ ///
+ public static string CheckingForUpdate {
+ get {
+ return ResourceManager.GetString("CheckingForUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to _Check for Update.
+ ///
+ public static string CheckUpdate {
+ get {
+ return ResourceManager.GetString("CheckUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Check _Now.
+ ///
+ public static string checkVersionNowButton {
+ get {
+ return ResourceManager.GetString("checkVersionNowButton", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to _Check for a new version on startup.
+ ///
+ public static string checkVersionOnStartupCheckBox {
+ get {
+ return ResourceManager.GetString("checkVersionOnStartupCheckBox", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Close.
+ ///
+ public static string CloseButtonText {
+ get {
+ return ResourceManager.GetString("CloseButtonText", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to delete the selected items?.
+ ///
+ public static string ConfirmDeleteItemss {
+ get {
+ return ResourceManager.GetString("ConfirmDeleteItemss", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Confirm Delete.
+ ///
+ public static string ConfirmDeleteTitle {
+ get {
+ return ResourceManager.GetString("ConfirmDeleteTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Delete.
+ ///
+ public static string DeleteItemLink {
+ get {
+ return ResourceManager.GetString("DeleteItemLink", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Delete Item.
+ ///
+ public static string DeleteItemToolTip {
+ get {
+ return ResourceManager.GetString("DeleteItemToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Downloading update....
+ ///
+ public static string DownloadingUpdate {
+ get {
+ return ResourceManager.GetString("DownloadingUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Edit.
+ ///
+ public static string EditItemLink {
+ get {
+ return ResourceManager.GetString("EditItemLink", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Edit Item.
+ ///
+ public static string EditItemToolTip {
+ get {
+ return ResourceManager.GetString("EditItemToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Installing update....
+ ///
+ public static string InstallingUpdate {
+ get {
+ return ResourceManager.GetString("InstallingUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Item.
+ ///
+ public static string ItemColumnHeader {
+ get {
+ return ResourceManager.GetString("ItemColumnHeader", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Add Item.
+ ///
+ public static string ItemWindowAdd {
+ get {
+ return ResourceManager.GetString("ItemWindowAdd", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Edit Item.
+ ///
+ public static string ItemWindowEdit {
+ get {
+ return ResourceManager.GetString("ItemWindowEdit", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Loading....
+ ///
+ public static string Loading {
+ get {
+ return ResourceManager.GetString("Loading", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Name.
+ ///
+ public static string NameColumnHeader {
+ get {
+ return ResourceManager.GetString("NameColumnHeader", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to OK.
+ ///
+ public static string OkayButton {
+ get {
+ return ResourceManager.GetString("OkayButton", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to About.
+ ///
+ public static string optionCategoryAbout {
+ get {
+ return ResourceManager.GetString("optionCategoryAbout", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to General.
+ ///
+ public static string optionCategoryGeneral {
+ get {
+ return ResourceManager.GetString("optionCategoryGeneral", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Items.
+ ///
+ public static string optionCategoryItems {
+ get {
+ return ResourceManager.GetString("optionCategoryItems", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Update.
+ ///
+ public static string optionCategoryUpdate {
+ get {
+ return ResourceManager.GetString("optionCategoryUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Settings.
+ ///
+ public static string SettingsTitle {
+ get {
+ return ResourceManager.GetString("SettingsTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to _Start when Windows starts.
+ ///
+ public static string startWithWindowsCheckBox {
+ get {
+ return ResourceManager.GetString("startWithWindowsCheckBox", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You are already running the most recent version.
+ ///
+ ///No updates are available at this time..
+ ///
+ public static string UpdateCheckCurrent {
+ get {
+ return ResourceManager.GetString("UpdateCheckCurrent", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Version {0} is now available.
+ ///
+ ///Would you like to download and install it now?.
+ ///
+ public static string UpdateCheckNewVersion {
+ get {
+ return ResourceManager.GetString("UpdateCheckNewVersion", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} Update.
+ ///
+ public static string UpdateCheckTitle {
+ get {
+ return ResourceManager.GetString("UpdateCheckTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Version {0}.
+ ///
+ public static string Version {
+ get {
+ return ResourceManager.GetString("Version", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/Template/Properties/Resources.resx b/Template/Properties/Resources.resx
new file mode 100644
index 0000000..c795a66
--- /dev/null
+++ b/Template/Properties/Resources.resx
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\Application.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Template Status Window
+
+
+ About
+
+
+ _Check for Update
+
+
+ _Start when Windows starts
+
+
+ General
+
+
+ Settings
+
+
+ Close
+
+
+ Version {0}
+
+
+ Update
+
+
+ _Check for a new version on startup
+
+
+ Check _Now
+
+
+ {0} Update
+
+
+ You are already running the most recent version.
+
+No updates are available at this time.
+
+
+ Version {0} is now available.
+
+Would you like to download and install it now?
+
+
+ Loading...
+
+
+ Checking for update...
+
+
+ Downloading update...
+
+
+ Installing update...
+
+
+ Items
+
+
+ Name
+
+
+ Item
+
+
+ Add
+
+
+ Edit
+
+
+ Delete
+
+
+ Add Item
+
+
+ Edit Item
+
+
+ Delete Item
+
+
+ Confirm Delete
+
+
+ Are you sure you want to delete the selected items?
+
+
+ Add Item
+
+
+ Edit Item
+
+
+ OK
+
+
+ Cancel
+
+
\ No newline at end of file
diff --git a/Template/Properties/Settings.Designer.cs b/Template/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..c619066
--- /dev/null
+++ b/Template/Properties/Settings.Designer.cs
@@ -0,0 +1,74 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Template.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "18.4.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string WindowSettings {
+ get {
+ return ((string)(this["WindowSettings"]));
+ }
+ set {
+ this["WindowSettings"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool AutoStart {
+ get {
+ return ((bool)(this["AutoStart"]));
+ }
+ set {
+ this["AutoStart"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool CheckVersionAtStartup {
+ get {
+ return ((bool)(this["CheckVersionAtStartup"]));
+ }
+ set {
+ this["CheckVersionAtStartup"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("[]")]
+ public string Items {
+ get {
+ return ((string)(this["Items"]));
+ }
+ set {
+ this["Items"] = value;
+ }
+ }
+ }
+}
diff --git a/Template/Properties/Settings.settings b/Template/Properties/Settings.settings
new file mode 100644
index 0000000..9c0ca86
--- /dev/null
+++ b/Template/Properties/Settings.settings
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+ True
+
+
+ True
+
+
+ []
+
+
+
\ No newline at end of file
diff --git a/Template/README.md b/Template/README.md
new file mode 100644
index 0000000..630b323
--- /dev/null
+++ b/Template/README.md
@@ -0,0 +1 @@
+# Template
\ No newline at end of file
diff --git a/Template/Resources/Application.ico b/Template/Resources/Application.ico
new file mode 100644
index 0000000..498c8b8
Binary files /dev/null and b/Template/Resources/Application.ico differ
diff --git a/Template/SettingsWindow/AboutSettingsPanel.xaml b/Template/SettingsWindow/AboutSettingsPanel.xaml
new file mode 100644
index 0000000..b0b1e3a
--- /dev/null
+++ b/Template/SettingsWindow/AboutSettingsPanel.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Template/SettingsWindow/AboutSettingsPanel.xaml.cs b/Template/SettingsWindow/AboutSettingsPanel.xaml.cs
new file mode 100644
index 0000000..55446cf
--- /dev/null
+++ b/Template/SettingsWindow/AboutSettingsPanel.xaml.cs
@@ -0,0 +1,12 @@
+namespace Template.SettingsWindow
+{
+ public partial class AboutSettingsPanel
+ {
+ public AboutSettingsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override string CategoryName => Properties.Resources.optionCategoryAbout;
+ }
+}
\ No newline at end of file
diff --git a/Template/SettingsWindow/GeneralSettingsPanel.xaml b/Template/SettingsWindow/GeneralSettingsPanel.xaml
new file mode 100644
index 0000000..a0aa607
--- /dev/null
+++ b/Template/SettingsWindow/GeneralSettingsPanel.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Template/SettingsWindow/GeneralSettingsPanel.xaml.cs b/Template/SettingsWindow/GeneralSettingsPanel.xaml.cs
new file mode 100644
index 0000000..afb9f26
--- /dev/null
+++ b/Template/SettingsWindow/GeneralSettingsPanel.xaml.cs
@@ -0,0 +1,36 @@
+using System.Windows;
+using ChrisKaczor.Wpf.Application;
+using Template.Properties;
+
+namespace Template.SettingsWindow;
+
+public partial class GeneralSettingsPanel
+{
+ public GeneralSettingsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override string CategoryName => Properties.Resources.optionCategoryGeneral;
+
+ public override void LoadPanel(Window parentWindow)
+ {
+ base.LoadPanel(parentWindow);
+
+ MarkLoaded();
+ }
+
+ private void OnSaveSettings(object sender, RoutedEventArgs e)
+ {
+ SaveSettings();
+ }
+
+ private void SaveSettings()
+ {
+ if (!HasLoaded) return;
+
+ Settings.Default.Save();
+
+ Application.Current.SetStartWithWindows(Settings.Default.AutoStart);
+ }
+}
\ No newline at end of file
diff --git a/Template/SettingsWindow/ItemWindow.xaml b/Template/SettingsWindow/ItemWindow.xaml
new file mode 100644
index 0000000..1e8dd90
--- /dev/null
+++ b/Template/SettingsWindow/ItemWindow.xaml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Template/SettingsWindow/ItemWindow.xaml.cs b/Template/SettingsWindow/ItemWindow.xaml.cs
new file mode 100644
index 0000000..954b527
--- /dev/null
+++ b/Template/SettingsWindow/ItemWindow.xaml.cs
@@ -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();
+ }
+}
\ No newline at end of file
diff --git a/Template/SettingsWindow/ItemsSettingsPanel.xaml b/Template/SettingsWindow/ItemsSettingsPanel.xaml
new file mode 100644
index 0000000..abd5508
--- /dev/null
+++ b/Template/SettingsWindow/ItemsSettingsPanel.xaml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Template/SettingsWindow/ItemsSettingsPanel.xaml.cs b/Template/SettingsWindow/ItemsSettingsPanel.xaml.cs
new file mode 100644
index 0000000..4fa57c9
--- /dev/null
+++ b/Template/SettingsWindow/ItemsSettingsPanel.xaml.cs
@@ -0,0 +1,112 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+
+namespace Template.SettingsWindow;
+
+public partial class ItemsSettingsPanel
+{
+ private CollectionViewSource _collectionViewSource;
+
+ public ItemsSettingsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override string CategoryName => Properties.Resources.optionCategoryItems;
+
+ public override void LoadPanel(Window parentWindow)
+ {
+ base.LoadPanel(parentWindow);
+
+ if (_collectionViewSource == null)
+ {
+ _collectionViewSource = new CollectionViewSource { Source = Data.ItemEntries };
+
+ ItemDataGrid.ItemsSource = _collectionViewSource.View;
+ }
+
+ _collectionViewSource.View.Refresh();
+
+ if (ItemDataGrid.Items.Count > 0)
+ ItemDataGrid.SelectedIndex = 0;
+
+ SetItemButtonStates();
+ }
+
+ private void HandleItemDataGridSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ SetItemButtonStates();
+ }
+
+ private void SetItemButtonStates()
+ {
+ AddItemButton.IsEnabled = true;
+ EditItemButton.IsEnabled = ItemDataGrid.SelectedItems.Count == 1;
+ DeleteItemButton.IsEnabled = ItemDataGrid.SelectedItems.Count > 0;
+ }
+
+ private void HandleAddItemButtonClick(object sender, RoutedEventArgs e)
+ {
+ AddItem();
+ }
+
+ private void HandleEditItemButtonClick(object sender, RoutedEventArgs e)
+ {
+ EditSelectedItem();
+ }
+
+ private void HandleDeleteItemButtonClick(object sender, RoutedEventArgs e)
+ {
+ DeleteSelectedItems();
+ }
+
+ private void HandleItemDataGridRowMouseDoubleClick(object sender, MouseButtonEventArgs e)
+ {
+ EditSelectedItem();
+ }
+
+ private void AddItem()
+ {
+ var itemEntry = new ItemEntry { };
+
+ var itemWindow = new ItemWindow();
+
+ var result = itemWindow.Display(itemEntry, Window.GetWindow(this));
+
+ if (!result.HasValue || !result.Value)
+ return;
+
+ ItemDataGrid.SelectedItem = itemEntry;
+
+ SetItemButtonStates();
+ }
+
+ private void EditSelectedItem()
+ {
+ if (ItemDataGrid.SelectedItem == null)
+ return;
+
+ var itemEntry = (ItemEntry)ItemDataGrid.SelectedItem;
+
+ var itemWindow = new ItemWindow();
+
+ itemWindow.Display(itemEntry, Window.GetWindow(this));
+ }
+
+ private void DeleteSelectedItems()
+ {
+ if (MessageBox.Show(ParentWindow!, Properties.Resources.ConfirmDeleteItemss, Properties.Resources.ConfirmDeleteTitle, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
+ return;
+
+ var selectedItems = new ItemEntry[ItemDataGrid.SelectedItems.Count];
+
+ ItemDataGrid.SelectedItems.CopyTo(selectedItems, 0);
+
+ foreach (var itemEntry in selectedItems)
+ Data.ItemEntries.Remove(itemEntry);
+
+ SetItemButtonStates();
+ }
+}
\ No newline at end of file
diff --git a/Template/SettingsWindow/UpdateSettingsPanel.xaml b/Template/SettingsWindow/UpdateSettingsPanel.xaml
new file mode 100644
index 0000000..d6367d5
--- /dev/null
+++ b/Template/SettingsWindow/UpdateSettingsPanel.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Template/SettingsWindow/UpdateSettingsPanel.xaml.cs b/Template/SettingsWindow/UpdateSettingsPanel.xaml.cs
new file mode 100644
index 0000000..8012334
--- /dev/null
+++ b/Template/SettingsWindow/UpdateSettingsPanel.xaml.cs
@@ -0,0 +1,38 @@
+using System.Windows;
+using System.Windows.Input;
+using Template.Properties;
+
+namespace Template.SettingsWindow;
+
+public partial class UpdateSettingsPanel
+{
+ public UpdateSettingsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override string CategoryName => Properties.Resources.optionCategoryUpdate;
+
+ private async void HandleCheckVersionNowButtonClick(object sender, RoutedEventArgs e)
+ {
+ var cursor = Cursor;
+
+ Cursor = Cursors.Wait;
+
+ await UpdateCheck.DisplayUpdateInformation(true);
+
+ Cursor = cursor;
+ }
+
+ private void OnSaveSettings(object sender, RoutedEventArgs e)
+ {
+ SaveSettings();
+ }
+
+ private void SaveSettings()
+ {
+ if (!HasLoaded) return;
+
+ Settings.Default.Save();
+ }
+}
\ No newline at end of file
diff --git a/Template/Template.csproj b/Template/Template.csproj
new file mode 100644
index 0000000..e1530b3
--- /dev/null
+++ b/Template/Template.csproj
@@ -0,0 +1,57 @@
+
+
+ net10.0-windows7.0
+ WinExe
+ true
+ true
+ Template.Program
+ Resources\Application.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ True
+ Settings.settings
+
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+ PublicResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/Template/UpdateCheck.cs b/Template/UpdateCheck.cs
new file mode 100644
index 0000000..9d76782
--- /dev/null
+++ b/Template/UpdateCheck.cs
@@ -0,0 +1,50 @@
+using System.Threading.Tasks;
+using System.Windows;
+using NuGet.Versioning;
+using Serilog;
+using Velopack;
+using Velopack.Sources;
+
+namespace Template;
+
+internal static class UpdateCheck
+{
+ private static UpdateManager _updateManager;
+
+ public static UpdateManager UpdateManager => _updateManager ??= new UpdateManager(new GithubSource("https://github.com/user/Template", null, false));
+
+ public static string LocalVersion => (UpdateManager.CurrentVersion ?? new SemanticVersion(0, 0, 0)).ToString();
+
+ public static bool IsInstalled => UpdateManager.IsInstalled;
+
+ public static async Task DisplayUpdateInformation(bool showIfCurrent)
+ {
+ var newVersion = IsInstalled ? await UpdateManager.CheckForUpdatesAsync() : null;
+
+ if (newVersion != null)
+ {
+ var updateCheckTitle = string.Format(Properties.Resources.UpdateCheckTitle, Properties.Resources.ApplicationName);
+
+ var updateCheckMessage = string.Format(Properties.Resources.UpdateCheckNewVersion, newVersion.TargetFullRelease.Version);
+
+ if (MessageBox.Show(updateCheckMessage, updateCheckTitle, MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
+ return;
+
+ Log.Logger.Information("Downloading update");
+
+ await UpdateManager.DownloadUpdatesAsync(newVersion);
+
+ Log.Logger.Information("Installing update");
+
+ UpdateManager.ApplyUpdatesAndRestart(newVersion);
+ }
+ else if (showIfCurrent)
+ {
+ var updateCheckTitle = string.Format(Properties.Resources.UpdateCheckTitle, Properties.Resources.ApplicationName);
+
+ var updateCheckMessage = string.Format(Properties.Resources.UpdateCheckCurrent, Properties.Resources.ApplicationName);
+
+ MessageBox.Show(updateCheckMessage, updateCheckTitle, MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Template/WindowSource.cs b/Template/WindowSource.cs
new file mode 100644
index 0000000..7ac9067
--- /dev/null
+++ b/Template/WindowSource.cs
@@ -0,0 +1,173 @@
+using ChrisKaczor.Wpf.Windows;
+using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
+using Serilog;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Timers;
+using System.Windows.Threading;
+using Template.Properties;
+using Template.SettingsWindow;
+
+namespace Template;
+
+internal class WindowSource : IWindowSource, IDisposable
+{
+ private readonly FloatingStatusWindow _floatingStatusWindow;
+ private readonly Timer _timer;
+ private readonly Dispatcher _dispatcher;
+
+ internal WindowSource()
+ {
+ _floatingStatusWindow = new FloatingStatusWindow(this);
+ _floatingStatusWindow.SetText(Resources.Loading);
+
+ _dispatcher = Dispatcher.CurrentDispatcher;
+
+ _timer = new Timer(1000);
+
+ Task.Factory.StartNew(UpdateApp).ContinueWith(task => Start(task.Result.Result));
+ }
+
+ private async Task UpdateApp()
+ {
+ try
+ {
+ if (!UpdateCheck.IsInstalled)
+ return false;
+
+ if (!Settings.Default.CheckVersionAtStartup)
+ return false;
+
+ Log.Logger.Information("Checking for update");
+
+ await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText(Resources.CheckingForUpdate));
+
+ var newVersion = await UpdateCheck.UpdateManager.CheckForUpdatesAsync();
+
+ if (newVersion == null)
+ return false;
+
+ Log.Logger.Information("Downloading update");
+
+ await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText(Resources.DownloadingUpdate));
+
+ await UpdateCheck.UpdateManager.DownloadUpdatesAsync(newVersion);
+
+ Log.Logger.Information("Installing update");
+
+ await _dispatcher.InvokeAsync(() => _floatingStatusWindow.SetText(Resources.InstallingUpdate));
+
+ UpdateCheck.UpdateManager.ApplyUpdatesAndRestart(newVersion);
+ }
+ catch (Exception e)
+ {
+ Log.Logger.Error(e, nameof(UpdateApp));
+ }
+
+ return true;
+ }
+
+ private void Start(bool hasUpdate)
+ {
+ Log.Logger.Information($"Start: hasUpdate={hasUpdate}");
+
+ if (hasUpdate)
+ return;
+
+ Log.Logger.Information("Load");
+
+ Load();
+
+ Log.Logger.Information("Starting timer");
+
+ _timer.Elapsed += HandleTimerElapsed;
+ _timer.Enabled = true;
+ }
+
+ private static void Load()
+ {
+ Data.Load();
+ }
+
+ private static void Save()
+ {
+ Data.Save();
+ }
+
+ private void HandleTimerElapsed(object sender, ElapsedEventArgs e)
+ {
+ var text = new StringBuilder();
+
+ if (Data.ItemEntries.Any())
+ {
+ foreach (var itemEntry in Data.ItemEntries)
+ {
+ if (text.Length > 0)
+ text.AppendLine();
+
+ text.Append($"{itemEntry.Name}");
+ }
+ }
+
+ _dispatcher.Invoke(() => _floatingStatusWindow.SetText(text.ToString()));
+ }
+
+ public void Dispose()
+ {
+ _timer.Enabled = false;
+ _timer.Dispose();
+
+ _floatingStatusWindow.Save();
+ _floatingStatusWindow.Dispose();
+ }
+
+ public Guid Id => Guid.Parse("29DF6CFD-6783-406F-AE12-4723EB7741EA");
+
+ public string Name => Resources.ApplicationName;
+
+ public System.Drawing.Icon Icon => Resources.ApplicationIcon;
+
+ public bool HasSettingsMenu => true;
+
+ public bool HasAboutMenu => false;
+
+ public void ShowAbout()
+ {
+ }
+
+ public void ShowSettings()
+ {
+ var categoryPanels = new List
+ {
+ new GeneralSettingsPanel(),
+ new ItemsSettingsPanel(),
+ new UpdateSettingsPanel(),
+ new AboutSettingsPanel()
+ };
+
+ var settingsWindow = new CategoryWindow(categoryPanels, Resources.SettingsTitle, Resources.CloseButtonText);
+
+ settingsWindow.ShowDialog();
+
+ Save();
+ }
+
+ public bool HasRefreshMenu => false;
+
+ public void Refresh()
+ {
+ }
+
+ public string WindowSettings
+ {
+ get => Settings.Default.WindowSettings;
+ set
+ {
+ Settings.Default.WindowSettings = value;
+ Settings.Default.Save();
+ }
+ }
+}
\ No newline at end of file