Skip to content

Commit

Permalink
Merge commit '6cc41fa8c98001d034a59d20cad83386ae16b5aa'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Jun 22, 2024
2 parents 0c497fc + 6cc41fa commit aae046b
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 19 deletions.
16 changes: 16 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/AppDemo/AppDemo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Uno.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-desktop</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UnoSingleProject>true</UnoSingleProject>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AvaloniaIDemo\AvaloniaIDemo.csproj" />
<ProjectReference Include="..\UnoDemo\UnoDemo\UnoDemo.csproj" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/AppDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppDemo;

internal class Program
{
[STAThread]
public static void Main(string[] args)
{
AvaloniaIDemo.Initializer.InitAssembly();

UnoDemo.Program.Main(args);
}
}
12 changes: 12 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/AvaloniaIDemo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaIDemo", "AvaloniaID
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoDemo", "UnoDemo\UnoDemo\UnoDemo.csproj", "{872051FD-06AD-4FA7-80AA-44FD8C63E0B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppDemo", "AppDemo\AppDemo.csproj", "{63AFC455-0A83-4CEF-BAF2-1AA5998C28DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibDemo", "LibDemo\LibDemo.csproj", "{0C4F55A4-A6EC-4CF8-B2B8-61673EB326DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -23,6 +27,14 @@ Global
{872051FD-06AD-4FA7-80AA-44FD8C63E0B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{872051FD-06AD-4FA7-80AA-44FD8C63E0B2}.Release|Any CPU.Build.0 = Release|Any CPU
{872051FD-06AD-4FA7-80AA-44FD8C63E0B2}.Release|Any CPU.Deploy.0 = Release|Any CPU
{63AFC455-0A83-4CEF-BAF2-1AA5998C28DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63AFC455-0A83-4CEF-BAF2-1AA5998C28DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63AFC455-0A83-4CEF-BAF2-1AA5998C28DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63AFC455-0A83-4CEF-BAF2-1AA5998C28DB}.Release|Any CPU.Build.0 = Release|Any CPU
{0C4F55A4-A6EC-4CF8-B2B8-61673EB326DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C4F55A4-A6EC-4CF8-B2B8-61673EB326DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C4F55A4-A6EC-4CF8-B2B8-61673EB326DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C4F55A4-A6EC-4CF8-B2B8-61673EB326DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
Expand All @@ -20,6 +19,6 @@


<ItemGroup>
<ProjectReference Include="..\UnoDemo\UnoDemo\UnoDemo.csproj" />
<ProjectReference Include="..\LibDemo\LibDemo.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using LibDemo;

namespace AvaloniaIDemo;

public static class Initializer
{
public static void InitAssembly()
{
Runner.SetAppRunner(new AppRunner());
}
}

file class AppRunner : IAppRunner
{
public void Run()
{
Program.Main([]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public static AppBuilder BuildAvaloniaApp()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}
}
6 changes: 6 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/LibDemo/IAppRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace LibDemo;

public interface IAppRunner
{
void Run();
}
9 changes: 9 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/LibDemo/LibDemo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
19 changes: 19 additions & 0 deletions AvaloniaIDemo/WawjejokeniDejeyaibeweji/LibDemo/Runner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LibDemo;

public static class Runner
{
public static void SetAppRunner(IAppRunner appRunner)
{
_appRunner = appRunner;
}

public static void Run() => _appRunner?.Run();

private static IAppRunner? _appRunner;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LibDemo;

namespace UnoDemo;

public sealed partial class MainPage : Page
Expand All @@ -9,20 +11,20 @@ public MainPage()

private void RunAvaloniaButton_OnClick(object sender, RoutedEventArgs e)
{
//// Create the new Thread to run the Avalonia
//var thread = new Thread(() =>
//{
// AvaloniaIDemo.Program.Main([]);
//})
//{
// IsBackground = true,
// Name = "Avalonia main thread"
//};
//if (OperatingSystem.IsWindows())
//{
// thread.SetApartmentState(ApartmentState.STA);
//}
//thread.Start();
// Create the new Thread to run the Avalonia

var thread = new Thread(() =>
{
Runner.Run();
})
{
IsBackground = true,
Name = "Avalonia main thread"
};
if (OperatingSystem.IsWindows())
{
thread.SetApartmentState(ApartmentState.STA);
}
thread.Start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<TargetFrameworks>
net8.0-windows10.0.19041;
net8.0-desktop;
net8.0;
</TargetFrameworks>

<OutputType>Exe</OutputType>
Expand Down Expand Up @@ -35,5 +34,11 @@
<UnoFeatures>
</UnoFeatures>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibDemo\LibDemo.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\PublishProfiles\" />
</ItemGroup>

</Project>

0 comments on commit aae046b

Please sign in to comment.