csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
using System;
|
|
using System.Linq;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Logging.Serilog;
|
|
using Avalonia.Platform;
|
|
using Serilog;
|
|
|
|
namespace ControlCatalog
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
InitializeLogging();
|
|
|
|
// TODO: Make this work with GTK/Skia/Cairo depending on command-line args
|
|
// again.
|
|
BuildAvaloniaApp().Start<MainWindow>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is needed for IDE previewer infrastructure
|
|
/// </summary>
|
|
public static AppBuilder BuildAvaloniaApp()
|
|
=> AppBuilder.Configure<App>().UsePlatformDetect();
|
|
|
|
// This will be made into a runtime configuration extension soon!
|
|
private static void InitializeLogging()
|
|
{
|
|
#if DEBUG
|
|
SerilogLogger.Initialize(new LoggerConfiguration()
|
|
.MinimumLevel.Warning()
|
|
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
|
|
.CreateLogger());
|
|
#endif
|
|
}
|
|
|
|
private static void ConfigureAssetAssembly(AppBuilder builder)
|
|
{
|
|
AvaloniaLocator.CurrentMutable
|
|
.GetService<IAssetLoader>()
|
|
.SetDefaultAssembly(typeof(App).Assembly);
|
|
}
|
|
}
|
|
}
|
|
|