wpf开发系列 开发笔记 nuget工具篇 nuget包工具命令 //删除包 dotnet nuget delete -s https://nuget.lingyanspace.com/v3/index.json LingYanAutoUpdate 1.0.0 -k nugetlingyanspace --non-interactive 打包篇 inno  中文环境【ChineseSimplified.isl】 ChineseSimplified.isl isl环境中文 Name: "english"; MessagesFile: "compiler:Default.isl" Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" 基础篇 依赖属性propdb public int MyProperty { get { return (int)GetValue(MyPropertyProperty); } set { SetValue(MyPropertyProperty, value); } } // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.Register("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0)); 附加属性propa public static int GetMyProperty(DependencyObject obj) { return (int)obj.GetValue(MyPropertyProperty); } public static void SetMyProperty(DependencyObject obj, int value) { obj.SetValue(MyPropertyProperty, value); } // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.RegisterAttached("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0)); xaml资源键类型 定义方式 优点 缺点 适用场景 普通字符串键 简单直观,易于使用 命名冲突风险,无法跨程序集共享 小型项目,局部资源 类型键 自动应用,无需显式引用 灵活性较低 全局样式,基础样式复用 静态资源键 强类型支持,可维护性高 定义稍复杂 大型项目,组件化开发 ComponentResourceKey 跨程序集支持,语义化标识 定义和使用复杂 组件库开发,主题或样式库 动态资源键 动态绑定,灵活性高 性能开销 主题切换,多语言支持 //普通字符串键 //静态资源键 public static class ResourceKeys { public static readonly string CloseButtonStyle = "CloseButtonStyle"; }