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.
38 lines
1.1 KiB
38 lines
1.1 KiB
using Avalonia;
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.ReactiveUI;
|
|
|
|
namespace RenderDemo
|
|
{
|
|
public class App : Application
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public override void OnFrameworkInitializationCompleted()
|
|
{
|
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
|
desktop.MainWindow = new MainWindow();
|
|
base.OnFrameworkInitializationCompleted();
|
|
}
|
|
|
|
// TODO: Make this work with GTK/Skia/Cairo depending on command-line args
|
|
// again.
|
|
static void Main(string[] args)
|
|
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
|
|
|
// App configuration, used by the entry point and previewer
|
|
static AppBuilder BuildAvaloniaApp()
|
|
=> AppBuilder.Configure<App>()
|
|
.With(new Win32PlatformOptions
|
|
{
|
|
OverlayPopups = true,
|
|
})
|
|
.UsePlatformDetect()
|
|
.UseReactiveUI()
|
|
.LogToTrace();
|
|
}
|
|
}
|
|
|