上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页
  2025年7月10日
摘要: SimpleWrap.axaml代码 <Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.micros 阅读全文
posted @ 2025-07-10 13:34 dalgleish 阅读(28) 评论(0) 推荐(0)
摘要: 扩展中增加了获取当前主窗口的代码 public static Control Current(this Control topLevel) { var mainWindow = (Application.Current?.ApplicationLifetime as IClassicDesktopS 阅读全文
posted @ 2025-07-10 13:16 dalgleish 阅读(56) 评论(0) 推荐(0)
  2025年7月9日
摘要: 扩展请参考 https://chuna2.787528.xyz/dalgleish/p/18972924 NonCompiledXaml.axaml代码 <Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.micro 阅读全文
posted @ 2025-07-09 13:32 dalgleish 阅读(720) 评论(0) 推荐(5)
  2025年7月8日
摘要: Avalonia配置,参考https://chuna2.787528.xyz/dalgleish/p/18967204 随时更新,目前已支持多个cs文件动态编译。 AvaloniaExtensions.cs代码 using Avalonia; using Avalonia.Controls; using 阅读全文
posted @ 2025-07-08 14:10 dalgleish 阅读(346) 评论(0) 推荐(0)
  2025年7月5日
摘要: EightBall.axaml <Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft 阅读全文
posted @ 2025-07-05 15:49 dalgleish 阅读(51) 评论(0) 推荐(0)
摘要: 项目结构 小技巧,修改AvaloniaUI.csproj,让下面代码替换所有ItemGroup。这样的好处是,以后Resources下建立的xaml,默认是AvaloniaResource,然后Resource\Xamls下的,是正常文件。 <ItemGroup> <AvaloniaResource 阅读全文
posted @ 2025-07-05 15:18 dalgleish 阅读(214) 评论(0) 推荐(0)
摘要: 学习导航 - 从C# Avalonia - 导航栏开始 1. 安装VS 2022 2. 打开x64 Native Tools Command Prompt for VS 2022,输入下面指令获取Avalonia模板 dotnet new install Avalonia.Templates 3. 阅读全文
posted @ 2025-07-05 14:17 dalgleish 阅读(1734) 评论(0) 推荐(1)
  2025年7月3日
摘要: 基于自己写的WpfButton,ButtonWithShape.xaml代码如下。 <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" x 阅读全文
posted @ 2025-07-03 09:00 dalgleish 阅读(36) 评论(0) 推荐(0)
摘要: 由于C# Maui是跨平台,所以按钮是没有写PointerOver这个样式的。本例子通过两种方法展示Button的Style修改。 方法一,使用xaml。这个方法,可以看我前面的教程,在App.xaml中添加MyStyles.xaml,然后自定义的按钮样式就可以被所有项目使用了。 <!--Butto 阅读全文
posted @ 2025-07-03 07:47 dalgleish 阅读(18) 评论(0) 推荐(0)
  2025年7月1日
摘要: 大家自行搜索下载Bayern.ttf,放入Resources/Fonts目录中,并且添加下面代码到MauiProgram.cs中。 EmbeddedFont.xaml <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http:/ 阅读全文
posted @ 2025-07-01 09:51 dalgleish 阅读(18) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页