Stylet.Avalonia
0.1.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Stylet.Avalonia --version 0.1.2
NuGet\Install-Package Stylet.Avalonia -Version 0.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stylet.Avalonia" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stylet.Avalonia --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Stylet.Avalonia, 0.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Stylet.Avalonia as a Cake Addin #addin nuget:?package=Stylet.Avalonia&version=0.1.2 // Install Stylet.Avalonia as a Cake Tool #tool nuget:?package=Stylet.Avalonia&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Stylet.Avalonia
请注意本项目需要 AvaloniaUI 版本 >= 0.11.0-preview
项目介绍
Stylet.Avalonia
是原来Stylet项目对AvaloniaUI 框架的适配。具体介绍请查看Stylet项目介绍
快速开始
第一步:创建一个AvaloniaUI框架
第二步:nuget 管理器安装 Stylet.Avalonia
包
第三步:创建AppBootstrapper
类,其内容如下
public class AppBootstrapper:Bootstrapper<RootViewModel>
{
}
第四步:创建ShellViewModel
类,以及Avalonia Window
类型名为ShellView
的窗口组件,其内容如下【其实啥也没动】
- ShellViewModel.cs
public class ShellViewModel
{
}
- ShellView.axaml
<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="Avalonia.NETCoreApp1.ShellView"
Title="ShellView">
Welcome to Avalonia!
</Window>
- ShellView.axaml.cs
public partial class ShellView : Window
{
public ShellView()
{
InitializeComponent();
#if DEBUG
this.AttachDevTools();
#endif
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
第五步:修改App.axaml
文件,其内容如下:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="using:Stylet.Xaml"
xmlns:local="using:Avalonia.NETCoreApp1"
x:Class="Avalonia.NETCoreApp1.App">
<Application.Resources>
<s:ApplicationLoader>
<s:ApplicationLoader.Bootstrapper>
<local:AppBootstrapper></local:AppBootstrapper>
</s:ApplicationLoader.Bootstrapper>
</s:ApplicationLoader>
</Application.Resources>
<Application.Styles>
<FluentTheme Mode="Light"/>
</Application.Styles>
</Application>
第六步:修改App.axaml.cs
文件,其内容如下:
using Avalonia.Markup.Xaml;
namespace Avalonia.NETCoreApp1
{
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
}
}
第七步:运行。快乐的写代码吧!
其他
更多资料点击这里跳转查看。同时,可以查看本仓库中存放的示例项目。
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Avalonia (>= 11.0.0-preview1)
- Avalonia.Diagnostics (>= 11.0.0-preview1)
- XamlNameReferenceGenerator (>= 1.3.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.