添加项目文件。
This commit is contained in:
parent
ca0c414718
commit
a7f6e6af74
16
App.axaml
Normal file
16
App.axaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<Application xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.App"
|
||||||
|
xmlns:sty="using:FluentAvalonia.Styling"
|
||||||
|
RequestedThemeVariant="Default"
|
||||||
|
>
|
||||||
|
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
|
||||||
|
|
||||||
|
<Application.Styles>
|
||||||
|
<!--<FluentTheme />-->
|
||||||
|
<sty:FluentAvaloniaTheme />
|
||||||
|
</Application.Styles>
|
||||||
|
<Application.Resources>
|
||||||
|
<FontFamily x:Key="LXGW WenKai">avares://wheel_mcl/Assets/Fonts/LXGWWenKai.ttf#LXGW WenKai</FontFamily>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
26
App.axaml.cs
Normal file
26
App.axaml.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Avalonia.Media;
|
||||||
|
|
||||||
|
namespace wheel_mcl
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
AvaloniaXamlLoader.Load(this);
|
||||||
|
base.Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnFrameworkInitializationCompleted()
|
||||||
|
{
|
||||||
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
|
{
|
||||||
|
desktop.MainWindow = new MainWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnFrameworkInitializationCompleted();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
AppBuilderExtension.cs
Normal file
16
AppBuilderExtension.cs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using Avalonia.Media;
|
||||||
|
|
||||||
|
namespace Avalonia;
|
||||||
|
|
||||||
|
public static class AppBuilderExtension
|
||||||
|
{
|
||||||
|
public static AppBuilder WithFont_LXGWWenKai(this AppBuilder appBuilder)
|
||||||
|
{
|
||||||
|
var uri = "avares://wheel_mcl/Assets/Fonts/LXGWWenKai.ttf#LXGW WenKai";
|
||||||
|
return appBuilder.With(new FontManagerOptions()
|
||||||
|
{
|
||||||
|
DefaultFamilyName = uri,
|
||||||
|
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(uri) } }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
BIN
Assets/Fonts/LXGWWenKai.ttf
Normal file
BIN
Assets/Fonts/LXGWWenKai.ttf
Normal file
Binary file not shown.
BIN
Assets/Fonts/LXGWWenKaiMono.ttf
Normal file
BIN
Assets/Fonts/LXGWWenKaiMono.ttf
Normal file
Binary file not shown.
46
MainWindow.axaml
Normal file
46
MainWindow.axaml
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<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"
|
||||||
|
xmlns:local="clr-namespace:wheel_mcl;assembly=wheel_mcl"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="wheel_mcl.MainWindow"
|
||||||
|
Title="wheel_mcl" FontFamily="LXGW WenKai">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="主页">
|
||||||
|
<ContentControl>
|
||||||
|
<local:Home/>
|
||||||
|
</ContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="下载">
|
||||||
|
<ContentControl>
|
||||||
|
<local:Downloads/>
|
||||||
|
</ContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="设置">
|
||||||
|
<ContentControl>
|
||||||
|
<local:Settings/>
|
||||||
|
</ContentControl>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="工具">
|
||||||
|
<ContentControl>
|
||||||
|
<local:Tools/>
|
||||||
|
</ContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="关于">
|
||||||
|
<ContentControl>
|
||||||
|
<local:About/>
|
||||||
|
</ContentControl>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
12
MainWindow.axaml.cs
Normal file
12
MainWindow.axaml.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace wheel_mcl
|
||||||
|
{
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
Pages/About.axaml
Normal file
5
Pages/About.axaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.About">
|
||||||
|
This is About
|
||||||
|
</UserControl>
|
13
Pages/About.axaml.cs
Normal file
13
Pages/About.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace wheel_mcl;
|
||||||
|
|
||||||
|
public partial class About : UserControl
|
||||||
|
{
|
||||||
|
public About()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
5
Pages/Downloads.axaml
Normal file
5
Pages/Downloads.axaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.Downloads">
|
||||||
|
This is Downloads!
|
||||||
|
</UserControl>
|
13
Pages/Downloads.axaml.cs
Normal file
13
Pages/Downloads.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace wheel_mcl;
|
||||||
|
|
||||||
|
public partial class Downloads : UserControl
|
||||||
|
{
|
||||||
|
public Downloads()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
5
Pages/Home.axaml
Normal file
5
Pages/Home.axaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.Home">
|
||||||
|
This is Home
|
||||||
|
</UserControl>
|
13
Pages/Home.axaml.cs
Normal file
13
Pages/Home.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace wheel_mcl;
|
||||||
|
|
||||||
|
public partial class Home : UserControl
|
||||||
|
{
|
||||||
|
public Home()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
5
Pages/Settings.axaml
Normal file
5
Pages/Settings.axaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.Settings">
|
||||||
|
This is Settings
|
||||||
|
</UserControl>
|
13
Pages/Settings.axaml.cs
Normal file
13
Pages/Settings.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace wheel_mcl;
|
||||||
|
|
||||||
|
public partial class Settings : UserControl
|
||||||
|
{
|
||||||
|
public Settings()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
5
Pages/Tools.axaml
Normal file
5
Pages/Tools.axaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="wheel_mcl.Tools">
|
||||||
|
This is Tools!
|
||||||
|
</UserControl>
|
13
Pages/Tools.axaml.cs
Normal file
13
Pages/Tools.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace wheel_mcl;
|
||||||
|
|
||||||
|
public partial class Tools : UserControl
|
||||||
|
{
|
||||||
|
public Tools()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
23
Program.cs
Normal file
23
Program.cs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
using Avalonia;
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace wheel_mcl
|
||||||
|
{
|
||||||
|
internal 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) => BuildAvaloniaApp()
|
||||||
|
.StartWithClassicDesktopLifetime(args);
|
||||||
|
|
||||||
|
// Avalonia configuration, don't remove; also used by visual designer.
|
||||||
|
public static AppBuilder BuildAvaloniaApp()
|
||||||
|
=> AppBuilder.Configure<App>()
|
||||||
|
.UsePlatformDetect()
|
||||||
|
.WithFont_LXGWWenKai()
|
||||||
|
.LogToTrace();
|
||||||
|
}
|
||||||
|
}
|
18
app.manifest
Normal file
18
app.manifest
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<!-- This manifest is used on Windows only.
|
||||||
|
Don't remove it as it might cause problems with window transparency and embedded controls.
|
||||||
|
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="wheel_mcl.Desktop"/>
|
||||||
|
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- A list of the Windows versions that this application has been tested on
|
||||||
|
and is designed to work with. Uncomment the appropriate elements
|
||||||
|
and Windows will automatically select the most compatible environment. -->
|
||||||
|
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
</assembly>
|
29
wheel_mcl.csproj
Normal file
29
wheel_mcl.csproj
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Assets\Fonts\LXGWWenKai.ttf" />
|
||||||
|
<None Remove="Assets\Fonts\LXGWWenKaiMono.ttf" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AvaloniaResource Include="Assets\Fonts\LXGWWenKai.ttf" />
|
||||||
|
<AvaloniaResource Include="Assets\Fonts\LXGWWenKaiMono.ttf" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Avalonia" Version="11.0.6" />
|
||||||
|
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
|
||||||
|
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.6" />
|
||||||
|
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||||
|
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
|
||||||
|
<PackageReference Include="FluentAvaloniaUI" Version="2.0.5" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
25
wheel_mcl.sln
Normal file
25
wheel_mcl.sln
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34525.116
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wheel_mcl", "wheel_mcl.csproj", "{CD9E6832-7FE8-4DF8-8B47-D836EA1DF961}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{CD9E6832-7FE8-4DF8-8B47-D836EA1DF961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{CD9E6832-7FE8-4DF8-8B47-D836EA1DF961}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{CD9E6832-7FE8-4DF8-8B47-D836EA1DF961}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{CD9E6832-7FE8-4DF8-8B47-D836EA1DF961}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {C40DBB04-7731-40B9-B632-26B18A60954B}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
Loading…
Reference in New Issue
Block a user