File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 11using LVGLSharp ;
22using LVGLSharp . Interop ;
3+ using LVGLSharp . Runtime . Windows ;
4+ using LVGLSharp . Runtime . Linux ;
5+ using System . ComponentModel . Design ;
36using System . Diagnostics ;
47using System . IO . Ports ;
58using System . Runtime . CompilerServices ;
@@ -28,7 +31,7 @@ unsafe class Program
2831
2932 static void Main ( string [ ] args )
3033 {
31- window = PlatformWindowFactory . Create ( ) ;
34+ window = CreateWindow ( ) ;
3235 window . Init ( ) ;
3336
3437 root = window . Root ;
@@ -40,6 +43,18 @@ static void Main(string[] args)
4043 window . StartLoop ( ( ) => { } ) ;
4144 }
4245
46+ static IWindow CreateWindow ( )
47+ {
48+ if ( Environment . OSVersion . Platform == PlatformID . Win32NT )
49+ {
50+ return new Win32Window ( "SerialPort" , 700 , 360 ) ;
51+ }
52+ else
53+ {
54+ return new LinuxView ( ) ;
55+ }
56+ }
57+
4358 [ UnmanagedCallersOnly ( CallConvs = new [ ] { typeof ( CallConvCdecl ) } ) ]
4459 static unsafe void RefButtonClick ( lv_event_t * obj )
4560 {
Original file line number Diff line number Diff line change 22
33<PropertyGroup >
44<OutputType >WinExe</OutputType >
5- <TargetFrameworks >net10.0-windows;net10.0</ TargetFrameworks >
5+ <TargetFramework >net10.0</ TargetFramework >
66<ImplicitUsings >enable</ImplicitUsings >
77<Nullable >enable</Nullable >
88<InvariantGlobalization >true</InvariantGlobalization >
99<AllowUnsafeBlocks >true</AllowUnsafeBlocks >
10- </PropertyGroup >
11-
12- <PropertyGroup Condition =" '$(TargetFramework)' == 'net10.0'" >
13- <PublishAot >true</PublishAot >
10+ <PublishAot >true</PublishAot >
1411</PropertyGroup >
1512
1613<ItemGroup >
2118
2219<ItemGroup >
2320<ProjectReference Include =" ..\..\LVGLSharp.Core\LVGLSharp.Core.csproj" />
21+ <ProjectReference Include =" ..\..\LVGLSharp.Windows\LVGLSharp.Runtime.Windows.csproj" />
22+ <ProjectReference Include =" ..\..\LVGLSharp.Runtime.Linux\LVGLSharp.Runtime.Linux.csproj" />
2423</ItemGroup >
2524
2625</Project >
You can’t perform that action at this time.
0 commit comments