上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页
  2025年7月10日
摘要: 扩展中增加了获取当前主窗口的代码 public static Control Current(this Control topLevel) { var mainWindow = (Application.Current?.ApplicationLifetime as IClassicDesktopS 阅读全文
posted @ 2025-07-10 13:16 dalgleish 阅读(44) 评论(0) 推荐(0)
  2025年7月9日
摘要: 扩展请参考 https://www.cnblogs.com/dalgleish/p/18972924 NonCompiledXaml.axaml代码 <Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.micro 阅读全文
posted @ 2025-07-09 13:32 dalgleish 阅读(585) 评论(0) 推荐(5)
  2025年7月8日
摘要: Avalonia配置,参考https://www.cnblogs.com/dalgleish/p/18967204 随时更新,目前已支持多个cs文件动态编译。 AvaloniaExtensions.cs代码 using Avalonia; using Avalonia.Controls; using 阅读全文
posted @ 2025-07-08 14:10 dalgleish 阅读(154) 评论(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 阅读(39) 评论(0) 推荐(0)
摘要: 项目结构 小技巧,修改AvaloniaUI.csproj,让下面代码替换所有ItemGroup。这样的好处是,以后Resources下建立的xaml,默认是AvaloniaResource,然后Resource\Xamls下的,是正常文件。 <ItemGroup> <AvaloniaResource 阅读全文
posted @ 2025-07-05 15:18 dalgleish 阅读(143) 评论(0) 推荐(0)
摘要: 1. 安装VS 2022 2. 打开x64 Native Tools Command Prompt for VS 2022,输入下面指令获取Avalonia模板 dotnet new install Avalonia.Templates 3. 在扩展中搜索“Avalonia for Visual S 阅读全文
posted @ 2025-07-05 14:17 dalgleish 阅读(582) 评论(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 阅读(16) 评论(0) 推荐(0)
摘要: 由于C# Maui是跨平台,所以按钮是没有写PointerOver这个样式的。本例子通过两种方法展示Button的Style修改。 方法一,使用xaml。这个方法,可以看我前面的教程,在App.xaml中添加MyStyles.xaml,然后自定义的按钮样式就可以被所有项目使用了。 <!--Butto 阅读全文
posted @ 2025-07-03 07:47 dalgleish 阅读(11) 评论(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 阅读(8) 评论(0) 推荐(0)
  2025年6月30日
摘要: 文中例子是基于wpf Canvas写的,由于Maui还没有支持Canvas,所以顺手自己写一个。之前写了一个InkCanvas,发现扩展性太差了,这次写这个Canvas,彻底解决扩展性问题,支持自定义碰撞测试等。自己写的碰撞测试,是基于点集碰撞测试,可以处理任何点集,所以大家可以继承Shape类,写 阅读全文
posted @ 2025-06-30 15:23 dalgleish 阅读(149) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页