jbe2277/waf

GitHub: jbe2277/waf

Win Application Framework (WAF) 是一个轻量级 .NET 框架,用于构建结构良好的 XAML 桌面应用程序,支持 MVVM 模式、分层架构以及 WPF、MAUI、WinUI 等多个平台。

Stars: 730 | Forks: 133

# Win Application Framework (WAF) #### WPF Application Framework 的继任者 Win Application Framework (WAF) 是一个轻量级框架,可帮助您构建结构良好的 XAML 应用程序(MAUI、WPF、WinUI)。它支持您应用各种架构模式: - [分层架构](https://github.com/jbe2277/waf/wiki/Layered-Architecture) - [Model-View-ViewModel 模式](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern) - [DataModel-View-ViewModel 模式](https://github.com/jbe2277/waf/wiki/DataModel-View-ViewModel-Pattern) **如何开始?** - WAF 附带了逼真的现实世界示例应用程序。请查看它们。请参阅下面的示例应用程序。 - [Wiki](https://github.com/jbe2277/waf/wiki) 提供了进一步的指导。 ## 支持的平台 - ***.Core** *(.NET 6.0 和 .NET Standard 2.0)*:支持所有基于 .NET 的应用程序。 - ***.Wpf** *(.NET 6.0 和 .NET Framework 4.7.2)*:对 Windows Presentation Foundation (WPF) 的扩展支持。 ## NuGet 包 - [更新日志](src/System.Waf/Changelog.md) Package | Usage | Successor of --- | --- | --- [System.Waf.Core](https://www.nuget.org/packages/System.Waf.Core) | 用于所有基于 .NET 的应用程序 | [System.Waf.Wpf](https://www.nuget.org/packages/System.Waf.Wpf) | 用于 WPF 应用程序 | [waf](https://www.nuget.org/packages/waf) [System.Waf.UnitTesting.Core](https://www.nuget.org/packages/System.Waf.UnitTesting.Core) | 用于所有基于 .NET 的应用程序的单元测试 | [System.Waf.UnitTesting.Wpf](https://www.nuget.org/packages/System.Waf.UnitTesting.Wpf) | 用于 WPF 应用程序的单元测试 | [waf.testing](https://www.nuget.org/packages/waf.testing) ## 功能 *System.Waf.Core* - *基础* - `Cache`:提供对值进行[缓存](https://github.com/jbe2277/waf/wiki/Cache-Pattern)的支持。 - `Model`:实现 [INotifyPropertyChanged](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged) 的基类。 - `ObservableList`:扩展了 `ObservableCollection`,增加了对 `INotifyCollectionChanging` 和 `INotifyCollectionItemChanged` 的支持。 - `ObservableListViewCore`:[为排序和过滤提供更改通知。](https://github.com/jbe2277/waf/wiki/ObservableListView%3A-Provide-change-notifications-for-sorting-and-filtering) - `SynchronizingList`:表示一个集合,该集合将其所有项与指定原始集合的项进行同步。 - `ThrottledAction`:对多次方法调用进行[节流](https://github.com/jbe2277/waf/wiki/Throttling-to-improve-responsiveness),以提高应用程序的响应能力。 - `ValidatableModel`:通过实现 [INotifyDataErrorInfo](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo) 支持验证的 Model 基类。 - `WeakEvent`:支持通过弱引用监听事件。这可以防止内存泄漏。有关更多详细信息,请参阅 [WeakEvent](https://github.com/jbe2277/waf/wiki/Weak-Event) 页面。 - *应用程序* - `ApplicationInfo`:提供有关正在运行的应用程序的信息。 - `(Async)DelegateCommand`:[ICommand](https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.icommand) 的一个实现,委托 Execute 和 CanExecute。 - `RecentFileList`:最近使用 (MRU) 的文件列表。 - `ViewModelCore`:[ViewModel](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern) 基类,采用简单的方法设置 DataContext。 - *呈现* - `SettingsService`:将用户设置作为 XML 文件加载和保存。 *System.Waf.Wpf* - *基础* - `DataErrorInfoSupport`:用于处理旧版 [IDataErrorInfo](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.idataerrorinfo) 接口的帮助类。 - *应用程序* - `ViewModel`:扩展 `ViewModelCore` 类,并使用 Dispatcher 自动初始化 DataContext。 - *呈现* - `DispatcherHelper`:DoEvents 的实现。 - `ResourceHelper`:在 WPF 中管理资源的帮助方法。 - `ValidationHelper`:支持数据验证跟踪。 - *转换器* - `BoolToVisibilityConverter`:将布尔值与 Visibility 值互相转换。 - `InvertBooleanConverter`:反转布尔值。 - `NullToVisibilityConverter`:检查是否为 null 并返回关联的 Visibility 值。 - `StringFormatConverter`:将对象转换为格式化字符串。 - `ValidationErrorsConverter`:将 ValidationError 集合转换为多行字符串错误消息。 - *服务* - `FileDialogService`:显示打开或保存文件对话框。 - `MessageService`:通过 MessageBox 显示消息。 *System.Waf.UnitTesting.Core* - `AssertHelper`:用于预期异常、[CanExecuteChanged](https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.icommand.canexecutechanged) 事件和 [PropertyChanged](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged) 事件的断言帮助方法。 - `UnitTestSynchronizationContext`:用于单元测试的[同步上下文](https://docs.microsoft.com/en-us/dotnet/api/system.threading.synchronizationcontext),模拟 UI 同步上下文的行为。 ## 示例应用程序 Name | Type | Description --- | --- | --- [Waf NewsReader](https://github.com/jbe2277/waf/tree/master/src/NewsReader) | MAUI 10
.NET 10 | 一个简单快速的 RSS 和 ATOM 新闻阅读器。
  • 平台:Android、Windows 和 iOS
  • 架构:[Layering](https://github.com/jbe2277/waf/wiki/Layered-Architecture), [MVVM](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern), 异步模式
  • 通过 MS Graph (OneDrive) 在多台设备间同步订阅源
  • OAuth 认证
  • 带有导航窗格的响应式 UI
  • 验证(添加订阅源视图)
  • 本地化(英语和德语)
[Waf Writer](https://github.com/jbe2277/waf/tree/master/src/System.Waf/Samples/Writer) | WPF
.NET 10 | 一个基础的文字处理应用程序。
  • 架构:[Layering](https://github.com/jbe2277/waf/wiki/Layered-Architecture), [MVVM](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern)
  • Ribbon 和选项卡式 MDI(多文档界面)
  • 页面间的动画过渡
  • 最近使用文件列表 (MRU)
  • 消息服务,打开/保存对话框服务
  • 打印预览和打印对话框
  • 本地化(英语和德语)
  • 使用 [FlaUI](https://github.com/FlaUI/FlaUI) 进行 UI 测试并通过 GitHub Actions 执行
[Waf Book Library](https://github.com/jbe2277/waf/tree/master/src/System.Waf/Samples/BookLibrary) | WPF
.NET 10 | 支持用户管理书籍。此应用程序可追踪借阅的书籍。
  • 架构:[Layering](https://github.com/jbe2277/waf/wiki/Layered-Architecture), [Extensions](https://github.com/jbe2277/waf/wiki/Modular-Architecture#4-alternative-extensions), [MVVM](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern), [DMVVM](https://github.com/jbe2277/waf/wiki/DataModel-View-ViewModel-Pattern)
  • Entity Framework 和 SQLite
  • 验证规则
  • DataGrid 中的排序和过滤
  • 通过 WPF FlowDocument 生成报告及打印支持
  • 使用 [FlaUI](https://github.com/FlaUI/FlaUI) 进行 UI 测试并通过 GitHub Actions 执行
[Waf Information Manager](https://github.com/jbe2277/waf/tree/master/src/System.Waf/Samples/InformationManager) | WPF
.NET 10 | 一个模块化应用程序,附带一个模拟电子邮件客户端和地址簿。
  • 架构:[Layering](https://github.com/jbe2277/waf/wiki/Layered-Architecture), [Modularization](https://github.com/jbe2277/waf/wiki/Modular-Architecture), [MVVM](https://github.com/jbe2277/waf/wiki/Model-View-ViewModel-Pattern)
  • 与所有模块共享的 Office 格式 ZIP 容器(Package API 和 DataContractSerializer)
  • 验证规则
  • 可扩展的导航视图和上下文相关工具栏
  • 向导对话框
  • 使用 [FlaUI](https://github.com/FlaUI/FlaUI) 进行 UI 测试并通过 GitHub Actions 执行
[Waf Music Manager](https://jbe2277.github.io/musicmanager/) | WPF
.NET 10 | 管理本地音乐收藏的快速且有趣的应用程序。
*MS Store (MSIX), WinRT, 媒体播放, 文件查询和属性, Async/await, 拖放* [Waf DotNetPad](https://jbe2277.github.io/dotnetpad) | WPF
.NET 10 | C# 和 Visual Basic 编程的代码编辑器。
*MS Store (MSIX), .NET Compiler Platform (Roslyn), AvalonEdit, 自动补全, Async/await* [Waf File Hash Generator](https://jbe2277.github.io/fhg/) | WinUI 3
.NET 9 | 生成一个或多个文件哈希值的简单工具。
*MS Store (MSIX), 异步, 进度, 拖放*
标签:DNS解析, MAUI, MVVM, WinUI, WPF, XAML, 分层架构, 单元测试, 基础库, 多人体追踪, 应用程序框架, 开源项目, 架构模式, 桌面开发, 类库, 系统开发, 组件