Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by OnProperty Changed
Why Nested ListView Breaks Down Faster Than You Expect in .NET MAUI
TL;DR: Nested Listview in .NET MAUI is often introduced as layouts grow more complex. This article explores where that pattern creates challenges and examines the alternative list structuring approaches commonly used instead. Using .NET MAUI ListView to build complex, data-heavy layouts often starts smoothly, especially when the UI structure closely mirrors the data model.
.NET MAUI State Management: From ViewModels to App Stores
TL;DR: Start with Mvvm and data binding for page-level state, apply Visual State Manager for visual-only changes, and rely on DI-backed app-wide stores for shared state. For highly interactive or complex flows, MVU or reducer-style unidirectional updates offer better predictability. State is the backbone of every .Net Maui application. It determines what users see, how the UI reacts to interactions, and how consistently data flows across screens.
Working with interfaces
This is a very good (informative) article. I really like the first part about using the IIdenity interface. However, I have two questions: 1) would you say that using this Interface would be applying the Adapter OOP pattern? Just curious about that. 2) The 2nd paragraph after the Basic Example heading is a bit confusing. Can you help me understand what you were saying?
Model Notification changed C#
Introduction Learn how to clean up a class/model that implements INotifyPropertyChanged. 🚦 This not for everyone, some developer may find this too much work. Even if this not for everyone, the secondary lesson is working with partial classes. Source code 📌 Coded in Microsoft Visual Studio 2022 using NET 8 Core. Conventual implementation Usually a developer will place property change notification directly in their classes as shown below.
FluentValidation inline validate
Learn FluentValidation inline validation One of the most important tasks in software development is to ensure that data saved meets requirements for business solutions. Learn how to use FluentValidation library to validate data for basic solutions using FluentValidation inline validation while for complex validation see the following article which demonstrates in both desktop and web projects. Note There is no formal documentation for inline validation. See source code.
[MAUI]集成富文本编辑器Editor.js至.NET MAUI Blazor项目
@ Editor.js 是一个基于 Web 的所见即所得富文本编辑器,它由CodeX团队开发。之前写过一篇博文专门介绍过这个编辑器,可以回看:开源好用的所见即所得(WYSIWYG)编辑器:Editor.js。 .NET MAUI Blazor允许使用 Web UI 生成跨平台本机应用。 组件在 .NET 进程中以本机方式运行,并使用本地互操作通道将 Web UI 呈现到嵌入式 Web 视图控件(BlazorWebView)。 这次我们将Editor.js集成到.NET MAUI应用中。并实现只读切换,明/暗主题切换等功能。 使用.NET MAUI实现跨平台支持,本项目可运行于Android、iOS平台。 获取资源 我们先要获取web应用的资源文件(js,css等),以便MAUI的视图呈现标准的Web UI。有两种方式可以获取: 从源码构建 从CDN获取 此方法需要首先安装nodejs 克隆Editorjs项目到本地 git clone https://github.com/codex-team/editor.js.git 运行 npm i 以及 npm run build...
CommunityToolkit.Mvvm笔记---ObservableObject-CSDN博客
ObservableObject 是通过实现 INotifyPropertyChanged 和 INotifyPropertyChanging 接口可观察的对象的基类。 1,ObservableObject 包含以下主要功能: 它提供了对 INotifyPropertyChanged 和 INotifyPropertyChanging 的基本实现,从而公开 PropertyChanged 和 PropertyChanging 事件。 它提供了一系列 SetProperty 方法,这些方法可用于轻松设置继承自 ObservableObject 的类型中的属性值,并自动引发相应的事件。 它提供了 SetPropertyAndNotifyOnCompletion 方法,该方法与 SetProperty 类似,但能够设置 Task 属性并在分配的任务完成后自动引发通知事件。 它公开了 OnPropertyChanged 和 OnPropertyChanging 方法,这些方法可在派生类型中重写,以自定义引发通知事件的方式。 2,ObservableObject在WPF中的应用 步骤 1:...
[MAUI]集成高德地图组件至.NET MAUI Blazor项目
@ 地图组件在手机App中常用地理相关业务,如查看线下门店,设置导航,或选取地址等。是一个较为常见的组件。 在.NET MAUI 中,有两种方案可以集成高德地图,一种是使用原生库绑定。网上也有人实现过:https://blog.csdn.net/sD7O95O/article/details/125827031 但这种方案需要大量平台原生开发的知识,而且需要对每一个平台进行适配。 在这里我介绍第二种方案:.NET MAUI Blazor + 高德地图JS API 2.0 库的实现。 JS API 2.0 是高德开放平台基于WebGL的地图组件,可以将高德地图模块集成到.NET MAUI Blazor中的BlazorWebView控件,由于BlazorWebView的跨平台特性,可以达到一次开发全平台通用,无需为每个平台做适配。 今天用此方法实现一个地图选择器,使用手机的GPS定位初始化当前位置,使用高德地图JS API库实现地点选择功能。混合开发方案涉及本机代码与JS runtime的交互,如果你对这一部分还不太了解,可以先阅读这篇文章:[MAUI]深入了解.NET MAUI...
Freezable ---探索WPF中Freezable承载数据的原理
引言 在之前写的一篇文章【WPF --- 如何以Binding方式隐藏DataGrid列】中,我先探索了 DataGridTextColumn 为什么不在可视化树结构内?又给出了解决方案,使用 Freezable ,该抽象类是 DependencyObject 的子类,能使用依赖属性在 Xaml 进行绑定,它承载了 DataContext 且有属性变化通知功能,触发 VisibilityConverter转换器,实现了预期功能。 然后有群友问了这样一个问题: 这里有两个问题: 非可视化树中的元素不能通过 RelativeSource 或者 ElementName 访问到可视化树中的数据,为何可以通过 resource 的方式访问? Freezable 类为何能够中转数据,DependencyObject 不行? 那么本篇文章就来探索一下 Freezable实现了上述功能的原理是什么? 原理探索 我们还是使用上一篇文章中的示例,让后为了便于剖析源码,做了部分改动。 首先,准备自定义 Freezable 类: public class CustomFreezable :...
WPF --- 如何以Binding方式隐藏DataGrid列
引言 如题,如何以Binding的方式动态隐藏DataGrid列? 预想方案 像这样: 先在ViewModel创建数据源 People 和控制列隐藏的 IsVisibility,这里直接以 MainWindow 为 DataContext public partial class MainWindow : Window, INotifyPropertyChanged { public MainWindow() { InitializeComponent(); Persons = new ObservableCollection<Person>() { new Person() { Age = 11, Name = "Peter" }, new Person() { Age = 19, Name = "Jack" } }; DataContext = this; } public event PropertyChangedEventHandler?
[MAUI]实现动态拖拽排序列表 - 林晓lx - 博客园
@ 上一章我们使用拖放(drag-drop)手势识别实现了可拖拽排序列表,对于列表中的条目,完整的拖拽排序过程是: 手指触碰条目 -> 拖拽条目 -> 拖拽悬停在另一个条目上方 -> 松开手指 -> 移动条目至此处。 其是在松开手指之后才向列表提交条目位置变更的命令。今天我们换一个写法,将拖拽条目放置在另一个条目上方时,即可将条目位置变更。即实时拖拽排序。 使用.NET MAU实现跨平台支持,本项目可运行于Android、iOS平台。 创建页面元素 新建.NET MAUI项目,命名Tile 本章的实例中使用网格布局的CollectionView控件作为Tile的容器。 CollectionView 的其他布局方式请参考官方文档 指定 CollectionView 布局 创建GridTilesPage.xaml 在页面中创建CollectionView, <CollectionView Grid.Row="1" x:Name="MainCollectionView" ItemsSource="{Binding TileSegments}">...
Implementing Desktop Apps with Windows 11 on Arm64 and .NET
This article is a sponsored article. Articles such as these are intended to provide you with information on products and services that we consider useful and of value to developers Download project files - 20.1 KB .NET is an open-source framework to build cross-platform applications for mobile, desktop, Internet of Things (IoT), and the web. The .NET platform also supports containerization and cloud-native solutions.
WPF基础入门-Class6-WPF通知更改_菜菜菜三菜的博客-CSDN博客
WPF基础入门 1、显示页面: <Grid> <StackPanel> <TextBox Text="{Binding Name}"></TextBox> <TextBox Text="{Binding Title}"></TextBox> <Button Command="{Binding ShowCommand}" Content="Show"></Button> </StackPanel> </Grid> 页面cs文件: InitializeComponent(); this.DataContext = new WPF_Learn.Model.model_csdn(); 2、新建一个ViewModelBase.cs文件 public class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler?
WPF基础入门-Class7-WPF-MVVN框架_菜菜菜三菜的博客-CSDN博客
菜菜菜三菜 于 2023-08-26 15:35:45 发布 205 收藏 分类专栏: WPF基础入门 文章标签: wpf
WPF自定义命令及属性改变处理_大浪淘沙胡的博客-CSDN博客
1、项目建构 2、自定义命令 namespace WpfDemo.Base { public class MyCommand : ICommand { Action executeAction; public MyCommand(Action action) { executeAction = action; } public event EventHandler? CanExecuteChanged; public bool CanExecute(object? parameter) { return true; } public void Execute(object? parameter) { executeAction(); } } } 3、属性改变 namespace WpfDemo.Base { public class ViewModelBase : INotifyPropertyChanged { public event PropertyChangedEventHandler?
[MAUI]在.NET MAUI中实现可拖拽排序列表
.NET MAUI 中提供了拖放(drag-drop)手势识别器,允许用户通过拖动手势来移动控件。在这篇文章中,我们将学习如何使用拖放手势识别器来实现可拖拽排序列表。在本例中,列表中显示不同大小的磁贴(Tile)并且可以拖拽排序。 使用.NET MAU实现跨平台支持,本项目可运行于Android、iOS平台。 创建可拖放控件 新建.NET MAUI项目,命名Tile 当手指触碰可拖拽区域超过一定时长(不同平台下时长不一定相同,如在Android中是1s)时,将触发拖动手势。 手指离开屏幕时,将触发放置手势。 启用拖动 为页面视图控件创建拖动手势识别器(DragGestureRecognizer), 它定义了以下属性: 属性类型描述 CanDrag bool 指明手势识别器附加到的控件能否为拖动源。 此属性的默认值为 true。 CanDrag bool 指明手势识别器附加到的控件能否为拖动源。 此属性的默认值为 true。 DragStartingCommand ICommand 在第一次识别拖动手势时执行。 DragStartingCommandParameter object...
[MAUI]在.NET MAUI中实现可拖拽排序列表
.NET MAUI 中提供了拖放(drag-drop)手势识别器,允许用户通过拖动手势来移动控件。在这篇文章中,我们将学习如何使用拖放手势识别器来实现可拖拽排序列表。在本例中,列表中显示不同大小的磁贴(Tile)并且可以拖拽排序。 使用.NET MAU实现跨平台支持,本项目可运行于Android、iOS平台。 创建可拖放控件 新建.NET MAUI项目,命名Tile 当手指触碰可拖拽区域超过一定时长(不同平台下时长不一定相同,如在Android中是1s)时,将触发拖动手势。 手指离开屏幕时,将触发放置手势。 启用拖动 为页面视图控件创建拖动手势识别器(DragGestureRecognizer), 它定义了以下属性: 属性 类型 描述 CanDrag bool 指明手势识别器附加到的控件能否为拖动源。 此属性的默认值为 true。 CanDrag bool 指明手势识别器附加到的控件能否为拖动源。 此属性的默认值为 true。 DragStartingCommand ICommand 在第一次识别拖动手势时执行。 DragStartingCommandParameter...
WPF 入门笔记 - 07 - MVVM示例
滴咚,大家好久不见💖。好就没写东西了,鸽着鸽着就无了😭。。。 回到正题,上篇文章说完命令提了一嘴MVVM模式直接就上MVVMLight这些程序的框架了,虽然也没说多少,但还是有点不好过渡,这篇对MVVM做一些系统学习,同时复习一下前几篇博文中的内容,完成一个采用MVVM模式的示例Demo。 🎶 小插曲 给N早之前文章中的可能混淆的内容做下说明 - 关于WPF 入门笔记 - 04 - 数据绑定 - OneWayToSource 文本框爆红现象: 在那篇文章一开始给初值是没问题的,因为OneWayToSource是将数据从绑定目标传递到绑定源,所以不给初值一定会出现绑定失败的问题 文本框爆红我觉得和绑定模式没有关系,我猜测和文本框绑定的数据类型有关,假设文本框绑定的是支持为空的string类型的字符串,它是空的话是不会爆红的,因为空会转化成"",但如果绑定的数据类型是不能为空的int类型,就会在文本框没有内容时出现爆红现象,同时会出现绑定失败 应该是这样,不对的话记得在评论区实现INotifyPropertyChanged接口教教我噢🛫 🎨 什么是MVVM MVVM 是...
c# - Begin and cease button in maui
I am doing a ping app utilizing .internet maui the code is working very nicely, nonetheless, i acquired an issue with the button when i attempted to do two occasions in the identical button whic is begin and cease the mainpage.xaml have this code utilizing listview <ListView x:Title="listViewRes" HorizontalScrollBarVisibility="At all times" HeightRequest="400" WidthRequest="400" VerticalScrollBarVisibility="At all times" ItemsSource="{Binding pingcollection}"> <ListView.ItemTemplate>...
[MAUI 项目实战] 手势控制音乐播放器(三): 动画
@ 上一章节我们创建了手势容器控件PanContainer,它对拖拽物进行包装并响应了平移手势和点击手势。 拖拽物现在虽然可以响应手势操作,但视觉效果较生硬,一个优秀的设计要求UI界面交互流畅,页面元素显得灵动,则少不了动画(Animation)。 本章节我们对拖拽物加入过渡动画 吸附动画 还记的上一章节所描述的拖拽物(pan)和坑(pit)吗?“”吸附“”这是一个非常拟物的过程,当拖拽物品接近坑区域的边缘时,物体就会由于重力或是引力作用会滑落,吸附在坑里。 接下来对势容器控件PanContainer添加这一效果,打开PanContainer.xaml.cs,创建一个bool类型的可绑定对象AutoAdsorption,用于控制是否开启吸附动画。 添加如下代码: public static readonly BindableProperty AutoAdsorptionProperty = BindableProperty.Create("AutoAdsorption", typeof(bool), typeof(PanContainer), default(bool));...
WPF之MVVM模式_wpf mvvm_鱼听禅的博客-CSDN博客
MVVM即模型-视图-视图模型 ,是用于解耦 UI 代码和非 UI 代码的 设计模式。 借助 MVVM,可以在 XAML 中以声明方式定义 UI,将 UI使用数据绑定标到包含数据和命令的其他层。 数据绑定提供数据和结构的松散耦合,使 UI 和链接的数据保持同步,同时可以将用户输入路由到相应的命令。 MVVM模式由M(Model),V(View),VM(ViewModel)三部分组成,其设计模式类似为MVC开发模式。目的是解耦UI和代码,编译编辑和修改。 通常一个View对应一个ViewModel,一个ViewModel可能包含n个model。 实际应用过程中可以对View中的不同控件绑定不同的ViewModel,变成一对多的模式。 View即UI界面,wpf使用xaml编,xaml是在xml的基础上开发的,整体风格与xml有诸多类似之处。 2.1绑定数据 View界面中需要通过数据绑定将具体的数据绑定到ViewModel的对应属性上。 <DataGrid x:Name="_dgSubItemList" Grid.Row="0" Margin="10,0,10,0"...
新手入门WPF之TreeView控件(二)_Тан Их的博客-CSDN博客
抱歉了各位,让你们久等了,现在我对WPF的理解更深了一步,那么,话不多说,动手开整。 这次的的内容在上一章的基础上讲解,本章要实现TreeView的增删改查,既然想实现增删改查,那就需要重定义数据结构了,目前我在项目上碰到关于树的结构就两种,一种是递归形式的结构,一种是每个节点结构不同的非递归结构。 先创建一个如图所示的项目,注意别创建错了,一个是启动项,一个是类库 我就举个例子演示TreeView增删改查,不如,我想实现一个目录树,这个目录树只需要显示节点的名字就行,知道需求后,先创建一个基类,用于通知前端刷新,我取名为BindableObject, 它继承一个系统提供的通知改变的接口,看图 可能有人会不理解BindableObject里面的代码,不急,最后补充的地方我会解释,你先这样理解:这是一个基类,我定义了一个字段(接口实现的)和一个方法(自定义的),以后就直接调用方法就能实现双向绑定。 有了通知类后,现在就按照需求定义一个关于目录树结构的对象,如图 让TreeModel继承通知这个基类,调用方法就能让该属性双向绑定了,因为是递归结构,所有还差一个属性(子节点)...
Xamarin CollectionView Selected Item
Explore Xamarin mobile app data collection techniques using CollectionView to manage selected items effectively. The framework for autonomous intelligence To effectively implement a CollectionView for selected items in Xamarin, it is essential to understand how to manage the selection state and display the selected items appropriately. The CollectionView control provides a flexible way to present data in a grid or list format, allowing for easy selection and manipulation of items.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with OnProperty
Contact OnProperty, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack