net6
文章平均质量分 86
茗杨AaronYang
胖乎乎的,但技术还好
展开
-
ay uno in net6 第8天
自己折腾下环境,翻墙到外网,大约半个小时后,编译安装东西,程序跑起来了。在window上用vs不能开发macos(xamarin)vs2022 preview3 扩展和更新搜索uno。你的C盘至少256G,不然估计很难受,建议512G。经过测试,就是个类似群聊,直播讨论的社区软件。群主定义标签,成员领用标签,群内分组跟清晰。一个xaml语法的page,做各种页面。可能需要安装东西,我的提示如下。原创 2023-11-20 10:54:24 · 22 阅读 · 0 评论 -
ay maui in net6 第13天 数据绑定基础
平台MAUIWPF字体颜色TextColorForeground垂直对齐字体加粗/斜体等FontWeight和FontStyle水平对齐背景色BackgroundLabel的TextAlignmentButton按钮边框厚度旋转自带Rotation配合Transform依赖属性边框颜色环境上下文。原创 2023-11-22 09:10:35 · 99 阅读 · 0 评论 -
ay maui in net6 第12天 基本xaml
..这样使用时候,可以省去 <ContentPage.Content>...平台MAUIWPF字体颜色TextColorForeground垂直对齐字体加粗/斜体等FontWeight和FontStyle水平对齐背景色BackgroundLabel的TextAlignmentButton按钮边框厚度旋转自带Rotation配合Transform依赖属性边框颜色。原创 2023-11-22 09:10:23 · 42 阅读 · 0 评论 -
ay wpf in net6 第10天 - 练手项目UI案例1 第11-20步
全当练手 布局和一些基本思路,实际使用需要配合 数据绑定,动态生成的数据11 信息卡片<!--信息卡片--><GridGrid.Row="1"Margin="50201540"><Grid.ColumnDefinitions><ColumnDefinitionWidth="*"/>原创 2023-11-21 09:05:12 · 54 阅读 · 0 评论 -
ay wpf in net6 第9天 - 练手项目UI案例1 第1-10步
TextBlock Text="下午好, AaronYang" FontSize="26" Foreground="#ccd7ff" HorizontalAlignment="Left" Margin="50 35 0 20"/><Button Style="{StaticResource topMenuButton}" Content="本周" Background="#5b60c4" Foreground="#FFFFFF"/><TextBlock Text="主页"/>原创 2023-11-20 10:55:23 · 63 阅读 · 0 评论 -
ay wpf in net6 第6天 - 引入CommunityToolkitMvvm 8.0 ObservableValidator
比如输入的内容,必须含有AY[Required]return new("输入的内容必须包含AY");输入AY后进行自定义验证的另一种方法是实现自定义 [ValidationAttribute]。然后将验证逻辑插入到重写的 IsValid 方法中。与上述方法相比,这提供了额外的灵活性,因为它可以很容易地在多个地方重用相同的属性。return new("输入的内容必须包含AY");然后在属性加上下面还有个参考的验证,比如获得当前类,某个属性的值,然后比较的。原创 2023-11-20 10:52:37 · 114 阅读 · 0 评论 -
ay wpf in net6 第5天 - 引入CommunityToolkitMvvm 8.0 RequestMessage和CollectionRequestMessage
m.Reply(new ModuleMenu { MenuCommand = () => { }, MenuName = "关闭" });m.Reply(new Teacher { TeacherName = "十年老师带token的" + "id=任意" });m.Reply(new Teacher { TeacherName = "杨老师带token的" + "id=1" });m.Reply(new Teacher { TeacherName = "杨老师带token的" });原创 2023-11-20 10:52:51 · 120 阅读 · 0 评论 -
ay wpf in net6 第4天 - 引入CommunityToolkitMvvm 8.0 消息接收
属性通知约定增加了OnXXXChanging方法和OnXXXChanged修改代码如下public string Info => $"你输入的姓名:{StuName}";set;Info2 += "姓名将要变为" + value+"\r\n";Info2 += "姓名已经变为" + value + "\r\n";输入partial就已经开始提示了xaml<TextBlock Text="姓名"/><TextBlock Text="班级"/>原创 2023-11-20 10:52:04 · 174 阅读 · 0 评论 -
ay wpf in net6 第3天 - 引入CommunityToolkitMvvm 8.0 - ICommand升级
如果有一个必须从特定类型继承的视图模型,但您还想在其中注入 INotifyPropertyChanged 支持,或者让它也从 ObservableRecipient 继承以访问其 API,该怎么办?MVVM 工具包现在包括一种解决此问题的方法,方法是引入代码生成属性,允许将这些类型的逻辑注入任意类。仍然支持在 VS2019 或其他旧 IDE 上使用 MVVM 工具包,但源代码生成器将在那里自动禁用,因此不支持依赖它们的功能。此外,还可以指定 CanExecute 方法,也可以控制异步命令的并发级别。原创 2023-11-20 10:51:51 · 123 阅读 · 0 评论 -
ay wpf in net6 第2天 - 引入CommunityToolkitMvvm 搭建项目和ViewModel升级
我们引入Mvvm的NET6版本学习示例按照规矩,先建立个ViewModels文件夹,添加MainWindowViewModel.cs由于MvvmLight弃用,我们就是用CommunityToolkitMvvm,现在时间2022-5-13我们改用下面任意一个,他们2个是一模一样的,我使用Community.Toolkit.Mvvm点击安装,直接最新版、这个的学习文档为什么选择他,AY认为很多技术都用到了这个Mvvm,比如Uno开发父类 ObservableObject 自带通知。原创 2023-11-20 10:51:37 · 777 阅读 · 0 评论 -
ay wpf in net6 第1天 - 引入依赖注入
Button Content="单击" Padding="16,10" Click="Button_Click" HorizontalAlignment="Center" VerticalAlignment="Center">这里MainWindow我们配置了单例,所以在App.xaml设置起始窗口就要注意了,我们修改App.xaml顶部的代码,移除StartupUri="MainWindow.xaml"回到App.xaml.cs,我们需要写个静态的serviceprovider。原创 2023-11-20 10:51:23 · 110 阅读 · 0 评论