Skip to content

Commit

Permalink
增加AvaloniaUI版,PC下可用,树莓派失败,原因是Mono的SkiaSharp未支持Linux32
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 7, 2019
1 parent e1a8a70 commit 0cfbde7
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 1 deletion.
8 changes: 8 additions & 0 deletions XCoderAv/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="XCoderAv.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
</Application.Styles>
</Application>
13 changes: 13 additions & 0 deletions XCoderAv/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Markup.Xaml;

namespace XCoderAv
{
public class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
}
}
9 changes: 9 additions & 0 deletions XCoderAv/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="XCoderAv.MainWindow"
Title="XCoderAv">
学无先后达者为师!
</Window>
22 changes: 22 additions & 0 deletions XCoderAv/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace XCoderAv
{
public class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
#if DEBUG
this.AttachDevTools();
#endif
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
27 changes: 27 additions & 0 deletions XCoderAv/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using Avalonia;
using Avalonia.Logging.Serilog;

namespace XCoderAv
{
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.
public static void Main(string[] args) => BuildAvaloniaApp().Start(AppMain, args);

// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToDebug();

// Your application's entry point. Here you can initialize your MVVM framework, DI
// container, etc.
private static void AppMain(Application app, string[] args)
{
app.Run(new MainWindow());
}
}
}
13 changes: 13 additions & 0 deletions XCoderAv/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PublishDir>..\..\XCoder\publish\</PublishDir>
</PropertyGroup>
</Project>
41 changes: 41 additions & 0 deletions XCoderAv/XCoderAv.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>XCoder</RootNamespace>
<AssemblyName>XCoder</AssemblyName>
<AssemblyTitle>新生命码神工具</AssemblyTitle>
<Description>众多开发者工具</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2019 新生命开发团队</Copyright>
<Version>8.0.2019.1007</Version>
<FileVersion>8.0.2019.1007</FileVersion>
<AssemblyVersion>8.0.*</AssemblyVersion>
<Deterministic>false</Deterministic>
<ApplicationIcon>..\XCoder\leaf.ico</ApplicationIcon>
<OutputPath>..\..\XCoder\</OutputPath>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;NC30;__CORE__</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.8.2" />
<PackageReference Include="Avalonia.Desktop" Version="0.8.2" />
<PackageReference Include="NewLife.Core" Version="8.4.2019.1007" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.0" />
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions XCoderAv/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
To use the Avalonia CI feed to get unstable packages, move this file to the root of your solution.
-->

<configuration>
<packageSources>
<add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2" />
</packageSources>
</configuration>
8 changes: 7 additions & 1 deletion 码神工具.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCoder", "XCoder\XCoder.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCoder40", "XCoder40\XCoder40.csproj", "{A4A7E1BD-9E53-4D60-A0E0-122E5441DDBF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCoder30", "XCoder30\XCoder30.csproj", "{604666BC-BB6C-426F-BE8F-A68592155698}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XCoder30", "XCoder30\XCoder30.csproj", "{604666BC-BB6C-426F-BE8F-A68592155698}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCoderAv", "XCoderAv\XCoderAv.csproj", "{66991C0D-D3A6-40E9-8BE1-C11F1F0D8894}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -34,6 +36,10 @@ Global
{604666BC-BB6C-426F-BE8F-A68592155698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{604666BC-BB6C-426F-BE8F-A68592155698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{604666BC-BB6C-426F-BE8F-A68592155698}.Release|Any CPU.Build.0 = Release|Any CPU
{66991C0D-D3A6-40E9-8BE1-C11F1F0D8894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66991C0D-D3A6-40E9-8BE1-C11F1F0D8894}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66991C0D-D3A6-40E9-8BE1-C11F1F0D8894}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66991C0D-D3A6-40E9-8BE1-C11F1F0D8894}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 0cfbde7

Please sign in to comment.