2

I have the same question Joe did, but for WinUI 3 desktop projects. Essentially, is there a way to trace what's happening and when, as XAML loads?

The solution for WPF appears to be a pre-defined set of TraceSources that simply need to be "turned on."

PresentationTraceSources.Refresh();
PresentationTraceSources.MarkupSource.Switch.Level = SourceLevels.All;

Is there anything similar for WinUI 3? I've tried enumerating TraceSources (similar to this article) but this only sees instantiated sources. I'd like to see if there are any sources embedded in SDK 1.1.2.

aturnbul
  • 347
  • 2
  • 12
  • Tooling around WinUI3 (and somehow UWP) is quite poor, however one big difference is lots of code is now generated. Typically the binding is, so you can put breakpoint in there. For example in C#, you'll see a MainWindow.g.i.cs in something like this folder obj\x64\Debug\net6.0-windows10.0.19041.0 (not bin, obj) – Simon Mourier Jul 11 '22 at 20:34
  • Thanks, Simon. Good point. I'll play around with that tomorrow. Do you know if there's some way to automatically insert code in the generated files? I'd like to insert a set of TraceSources for each build. – aturnbul Jul 11 '22 at 22:40

0 Answers0