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 Inotify PropertyChanged
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.
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?
.net、C#单元测试xUnit_步、步、为营的博客-CSDN博客
xUnit单元测试 测试的分类 xUnit xUnit是一个可对.net进行测试的框架,支持.Net Framework、.Net Core、.Net Standard、UWP、Xamarin。 测试一般针对Public方法进行测试,如果是私有方法需要改变修饰符才能进行测试。同时测试项目需添加对被测项目的引用,同时测试项目需要引入xUnit框架库。 最简单的测试 创建一个.net core类库:Demo,添加一个Calculator类 namespace Demo { public class Calculator { public int Add(int x,int y) { return x + y; } } } 在同一解决方案,创建一个xUnit测试项目:DemoTest 命名规则:一般是项目名+Test命名测试项目。创建一个类:CalculatorTests: public class CalculatorTests { [Fact] public void ShouldAddEquals5() { var sut = new Calculator(); var...
C# MVVM Toolkit Demo
It would be possible to save some lines of code with replacing a ParamCommand through a RelayCommand. Example: TBoxCommand = new RelayCommand<TextBox>(DoParamCommandTBox); ... public IRelayCommand<TextBox> TBoxCommand { get; } ... private void DoParamCommandTBox(object parameter) { _textData.ActiveTextBox = (TextBox)parameter; _textData.ActiveRichTextBox = null; OnPropertyChangedTest = "PlainText"; } you should update this to new toolkit , and use new command and new property shortcuts.
WPF - Creating Observable Enumerators
Introduction I was sitting around trying to recall WPF-related programming problems I had over the years, and remembered one involving creating observable collections of enumerator values. This happened to me long ago, and I can't find the code where I resolved the issue, but I do remebmer that it was specific to the enumerator involved, and that's actually a "bad thing" (TM). This article presents a debuggable generic approach, and should work for any enumerator you might decide is important.
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 Inotify
Contact Inotify, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack