Skip to content

Commit db6d1c6

Browse files
committed
重构为avalonia版本
1 parent e6dbec3 commit db6d1c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+734
-1364
lines changed

src/App.axaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Application xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
x:Class="GeneralUpdate.Tool.Avalonia.App"
4+
xmlns:local="using:GeneralUpdate.Tool.Avalonia"
5+
RequestedThemeVariant="Default">
6+
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
7+
<Application.Styles>
8+
<FluentTheme />
9+
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
10+
</Application.Styles>
11+
</Application>

src/App.axaml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Avalonia;
2+
using Avalonia.Controls.ApplicationLifetimes;
3+
using Avalonia.Markup.Xaml;
4+
using GeneralUpdate.Tool.Avalonia.ViewModels;
5+
using GeneralUpdate.Tool.Avalonia.Views;
6+
7+
namespace GeneralUpdate.Tool.Avalonia;
8+
9+
public partial class App : Application
10+
{
11+
public override void Initialize()
12+
{
13+
AvaloniaXamlLoader.Load(this);
14+
}
15+
16+
public override void OnFrameworkInitializationCompleted()
17+
{
18+
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
19+
{
20+
desktop.MainWindow = new MainWindow
21+
{
22+
DataContext = new MainWindowViewModel(),
23+
};
24+
}
25+
26+
base.OnFrameworkInitializationCompleted();
27+
}
28+
}

src/Assets/avalonia-logo.ico

172 KB
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
7+
<ApplicationManifest>app.manifest</ApplicationManifest>
8+
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<AvaloniaResource Include="Assets\**"/>
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Avalonia" Version="11.2.2" />
17+
<PackageReference Include="Avalonia.Desktop" Version="11.2.2" />
18+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.2" />
19+
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.2" />
20+
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
21+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.2" />
22+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.2" />
23+
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.2.0.1" />
24+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
25+
<PackageReference Include="GeneralUpdate.Differential" Version="9.0.0" />
26+
<PackageReference Include="Nlnet.Avalonia.MessageBox" Version="1.0.2" />
27+
<PackageReference Include="Semi.Avalonia" Version="11.2.1.1" />
28+
</ItemGroup>
29+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneralUpdate.Tool.Avalonia", "GeneralUpdate.Tool.Avalonia.csproj", "{4F819DD4-A905-4358-B338-6F6E759697BE}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{4F819DD4-A905-4358-B338-6F6E759697BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{4F819DD4-A905-4358-B338-6F6E759697BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{4F819DD4-A905-4358-B338-6F6E759697BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{4F819DD4-A905-4358-B338-6F6E759697BE}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

src/MAUI/Tool_src.zip

-1.14 MB
Binary file not shown.

src/Models/AppTypeModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace GeneralUpdate.Tool.Avalonia.Models;
2+
3+
public class AppTypeModel
4+
{
5+
public string DisplayName { get; set; }
6+
7+
public int Value { get; set; }
8+
9+
public override string ToString() => DisplayName;
10+
}

src/Models/EncodingModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Text;
2+
3+
namespace GeneralUpdate.Tool.Avalonia.Models;
4+
5+
public class EncodingModel
6+
{
7+
public string DisplayName { get; set; }
8+
9+
public Encoding Value { get; set; }
10+
11+
public int Type { get; set; }
12+
13+
public override string ToString() => DisplayName;
14+
}

src/Models/FormatModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace GeneralUpdate.Tool.Avalonia.Models;
2+
3+
public class FormatModel
4+
{
5+
public string DisplayName { get; set; }
6+
7+
public int Type { get; set; }
8+
9+
public string Value { get; set; }
10+
11+
public override string ToString() => DisplayName;
12+
}

src/Models/OperationType.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace GeneralUpdate.Tool.Avalonia.Models;
2+
3+
public enum OperationType
4+
{
5+
None,
6+
Zip,
7+
}

0 commit comments

Comments
 (0)