IceTea.Avalonia.Core
1.1.4
dotnet add package IceTea.Avalonia.Core --version 1.1.4
NuGet\Install-Package IceTea.Avalonia.Core -Version 1.1.4
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="IceTea.Avalonia.Core" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IceTea.Avalonia.Core" Version="1.1.4" />
<PackageReference Include="IceTea.Avalonia.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IceTea.Avalonia.Core --version 1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IceTea.Avalonia.Core, 1.1.4"
#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.
#:package IceTea.Avalonia.Core@1.1.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IceTea.Avalonia.Core&version=1.1.4
#tool nuget:?package=IceTea.Avalonia.Core&version=1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
IceTea.Avalonia.Core (Avalonia UI 核心组件库)
简介
IceTea.Avalonia.Core 是专为 Avalonia UI 框架设计的核心组件库,提供了丰富的附加属性、转换器、样式资源和实用工具。该库旨在简化 Avalonia 应用开发,提供一致的 UI 体验和高效的开发模式。
安装
dotnet add package IceTea.Avalonia.Core
核心功能模块
一、附加属性系统
MyAttachProperty - 自定义附加属性集合
提供一系列常用的附加属性,用于增强 Avalonia 控件的功能。
按钮相关附加属性:
IsIconButton- 图标按钮样式IsTransparentButton- 透明按钮样式IsNormalButton- 普通按钮样式
使用方式:
<Button Content="图标按钮"
local:MyAttachProperty.IsIconButton="True" />
<Button Content="透明按钮"
local:MyAttachProperty.IsTransparentButton="True" />
<Button Content="普通按钮"
local:MyAttachProperty.IsNormalButton="True" />
ButtonAttachProperty - 按钮专用附加属性 提供更多按钮相关的附加属性配置。
二、值转换器
1. OppositeBoolConverter - 布尔值反转转换器
将布尔值进行逻辑取反操作。
使用示例:
<TextBlock Text="{Binding IsVisible,
Converter={StaticResource OppositeBoolConverter}}" />
var converter = new OppositeBoolConverter();
bool result = (bool)converter.Convert(true, typeof(bool), null, CultureInfo.CurrentCulture);
// result = false
2. String2KeyGestureConverter - 字符串到键盘手势转换器
将字符串转换为 Avalonia 的 KeyGesture 对象。
使用示例:
<MenuItem Header="新建"
InputGesture="{Binding NewCommandGesture,
Converter={StaticResource String2KeyGestureConverter}}" />
三、事件系统
DialogMessageEvent - 对话框消息事件
用于在应用程序中传递对话框相关的消息事件。
四、资源字典
样式资源
提供预定义的样式和主题资源:
主要资源文件:
All.axaml- 所有资源的聚合AllStyle.axaml- 所有样式定义CommonConverters.axaml- 通用转换器资源CustomColors.axaml- 自定义颜色定义
样式目录:
Styles/- 各种控件样式定义Dictionaries/- 资源字典集合
使用方式:
<Application.Styles>
<StyleInclude Source="avares://IceTea.Avalonia.Core/Resources/All.axaml"/>
</Application.Styles>
五、配置工具
Configs目录 - 配置管理工具
提供 Avalonia 应用的配置管理功能。
六、热键工具
HotKey目录 - 热键管理工具
提供全局热键和快捷键管理功能。
使用指南
1. 应用程序级资源引入
在 App.axaml 中引入所有核心资源:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Styles>
<StyleInclude Source="avares://IceTea.Avalonia.Core/Resources/All.axaml"/>
</Application.Styles>
</Application>
2. 窗口级样式应用
在特定窗口中应用样式:
<Window xmlns="https://github.com/avaloniaui"
xmlns:local="clr-namespace:IceTea.Avalonia.Core.Attaches">
<Window.Styles>
<StyleInclude Source="avares://IceTea.Avalonia.Core/Resources/AllStyle.axaml"/>
</Window.Styles>
<Button Content="特殊按钮"
local:MyAttachProperty.IsIconButton="True"/>
</Window>
3. 转换器使用
在资源字典中定义转换器:
< converters:OppositeBoolConverter x:Key="OppositeBoolConverter"/>
< converters:String2KeyGestureConverter x:Key="String2KeyGestureConverter"/>
然后在绑定中使用:
<TextBlock Text="{Binding IsEnabled,
Converter={StaticResource OppositeBoolConverter}}"/>
核心特性
- 一致性UI体验:提供统一的控件样式和行为
- 可扩展性:模块化设计,易于扩展新的附加属性和转换器
- 性能优化:高效的资源管理和绑定机制
- 跨平台支持:完全兼容 Avalonia 的跨平台特性
- 现代化设计:遵循现代UI设计原则
典型应用场景
- 企业级应用:提供专业的企业应用UI组件
- 桌面工具:快速构建功能丰富的桌面应用程序
- 跨平台应用:一次开发,多平台部署
- 原型开发:快速构建应用原型和演示
依赖说明
- Avalonia:核心UI框架
- Avalonia.Themes.Fluent:Fluent设计主题
- Avalonia.Diagnostics:调试工具(开发环境)
兼容性
- Avalonia: 11.0+
- .NET: 6.0+
- 平台: Windows, Linux, macOS
许可证
MIT License
作者
WuMing
贡献
欢迎提交 Issue 和 Pull Request!
| 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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.3.18)
- IceTea.Atom (>= 1.4.9)
- Prism.Core (>= 8.1.97)
-
net8.0
- Avalonia (>= 11.3.18)
- IceTea.Atom (>= 1.4.9)
- Prism.Core (>= 8.1.97)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.4 | 115 | 7/31/2026 |
| 1.1.3 | 107 | 7/30/2026 |
| 1.1.2 | 109 | 7/12/2026 |
| 1.1.1 | 111 | 6/11/2026 |
| 1.1.0 | 110 | 6/11/2026 |
| 1.0.14 | 167 | 10/18/2025 |
| 1.0.13 | 249 | 9/21/2025 |
| 1.0.12 | 294 | 8/25/2025 |
| 1.0.11 | 147 | 8/23/2025 |
| 1.0.9 | 255 | 4/23/2025 |
| 1.0.7 | 188 | 3/1/2025 |
| 1.0.6 | 183 | 12/20/2024 |
| 1.0.5 | 188 | 12/3/2024 |
| 1.0.4 | 204 | 11/13/2024 |
| 1.0.3 | 217 | 9/3/2024 |
| 1.0.2 | 214 | 9/3/2024 |
| 1.0.1 | 226 | 8/17/2024 |
| 1.0.0 | 211 | 8/11/2024 |