Bring back C# sample logging!

This commit is contained in:
Caelan Sayler
2025-03-12 22:02:47 +00:00
committed by Caelan
parent 4f10c94565
commit a6337c5a22
7 changed files with 113 additions and 25 deletions

View File

@@ -5,6 +5,8 @@ namespace CSharpWpf
{
public partial class App : Application
{
public static MemoryLogger Log { get; private set; } = new();
// Since WPF has an "automatic" Program.Main, we need to create our own.
// In order for this to work, you must also add the following to your .csproj:
// <StartupObject>CSharpWpf.App</StartupObject>
@@ -15,6 +17,7 @@ namespace CSharpWpf
// It's important to Run() the VelopackApp as early as possible in app startup.
VelopackApp.Build()
.OnFirstRun((v) => { /* Your first run code here */ })
.SetLogger(Log)
.Run();
// We can now launch the WPF application as normal.