Program.cs 947 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Linq;
  4. using System.Diagnostics;
  5. using System.Windows.Threading;
  6. using Perspex;
  7. using Serilog;
  8. using Perspex.Logging.Serilog;
  9. namespace XamlTestApplication
  10. {
  11. internal class Program
  12. {
  13. private static void Main(string[] args)
  14. {
  15. // this sucks. Can we fix this? Do we even need it anymore?
  16. var foo = Dispatcher.CurrentDispatcher;
  17. InitializeLogging();
  18. new XamlTestApp()
  19. .UseWin32Subsystem()
  20. .UseDirect2D()
  21. .LoadFromXaml()
  22. .RunWithMainWindow<Views.MainWindow>();
  23. }
  24. private static void InitializeLogging()
  25. {
  26. #if DEBUG
  27. SerilogLogger.Initialize(new LoggerConfiguration()
  28. .MinimumLevel.Warning()
  29. .WriteTo.Trace(outputTemplate: "{Area}: {Message}")
  30. .CreateLogger());
  31. #endif
  32. }
  33. }
  34. }