Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
84 lines (68 loc) · 2.21 KB
/
Copy pathProgram.cs
File metadata and controls
84 lines (68 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// using Avalonia;
// using System;
//
// namespace Androidplayer;
//
// class Program
// {
// // Initialization code. Don't use any Avalonia, third-party APIs or any
// // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// // yet and stuff might break.
// [STAThread]
//
// public static void Main(string[] args)
// {
// StartupTimer.Mark("Main entered");
// BuildAvaloniaApp()
// .StartWithClassicDesktopLifetime(args);
// }
//
// // Avalonia configuration, don't remove; also used by visual designer.
// public static AppBuilder BuildAvaloniaApp()
// => AppBuilder.Configure<App>()
// .UsePlatformDetect()
// .WithInterFont()
// .With(new Win32PlatformOptions
// {
// RenderingMode = new[]
// {
// Win32RenderingMode.Software
// }
// })
//
//
// .LogToTrace();
// }
using Avalonia;
using System;
namespace Androidplayer;
class Program
{
[STAThread]
public static void Main(string[] args)
{
StartupTimer.Mark("Main entered");
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp()
{
var builder = AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
// Check if the OS is Windows 7 (Version 6.1)
var osVersion = Environment.OSVersion.Version;
if (osVersion.Major == 6 && osVersion.Minor == 1)
{
// Windows 7 detected: Force Software rendering
builder = builder.With(new Win32PlatformOptions
{
RenderingMode = new[] { Win32RenderingMode.Software }
});
Console.WriteLine("Running on windows 7 using software for ui");
}
// For all other OS versions, the default RenderingMode (AngleEgl, Software) is used.
return builder;
}
}