不同项目中的 WPF Mahapps 控件
WPF Mahapps Controls in different Project
我正在测试 MahApps.Metro,我有一个 WPF(Windows 应用程序类型项目)。
现在我在不同的项目 (WpfControlLibrary) 中创建了一些视图来存储用户控件以供 WPF 主项目使用。
如何在这个新的 WpfControlLibrary 中使用 MahApps.Metro 样式?
是否可以在此 WpfControlLibrary 中共享 App.xaml 和 WPF 主项目中存在的其他资源(如图标包)?
我需要在每个新的 WpfControlLibrary 中安装 MahApps.Metro 和 MAhApps.Metro.Resources 吗?
在主 WPF 项目中,我在 xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" 下声明了 "Controls:MetroWindow",对于 WpfControlLibrary 如何
谢谢
Is it possible to share App.xaml and other Resources (like the Icons package) existing in the WPF main project in this WpfControlLibrary?
没有,不是。
Do I need to install the MahApps.Metro and MahApps.Metro.Resources in each new WpfControlLibrary?
是的,你有。但这并没有看起来那么糟糕,相信我:
Visual Studio 使您可以选择管理整个解决方案的 NuGet 包。方法如下:
- 右键单击您的解决方案,然后 select
Manage NuGet Packages for Solution
- 此页面将打开:
您可以在此处轻松查看所有项目(在此解决方案中)上安装了哪些 NuGet 包、可用更新,甚至可以浏览以安装更多包。
如您所见,我 select 编辑了 MahApps.Metro 包,它向我显示版本 1.4.1 安装在 Helpers\SystemSpecs.Helpers
和 View\SystemSpecs.View
上(top-right 图片的一角)。
要在另一个项目上安装它,我所要做的就是 select 项目的 CheckBox 并单击 Install
。相同的过程适用于卸载它(除了您将单击 Uninstall
呵呵)。
我正在测试 MahApps.Metro,我有一个 WPF(Windows 应用程序类型项目)。 现在我在不同的项目 (WpfControlLibrary) 中创建了一些视图来存储用户控件以供 WPF 主项目使用。
如何在这个新的 WpfControlLibrary 中使用 MahApps.Metro 样式?
是否可以在此 WpfControlLibrary 中共享 App.xaml 和 WPF 主项目中存在的其他资源(如图标包)?
我需要在每个新的 WpfControlLibrary 中安装 MahApps.Metro 和 MAhApps.Metro.Resources 吗?
在主 WPF 项目中,我在 xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" 下声明了 "Controls:MetroWindow",对于 WpfControlLibrary 如何
谢谢
Is it possible to share App.xaml and other Resources (like the Icons package) existing in the WPF main project in this WpfControlLibrary?
没有,不是。
Do I need to install the MahApps.Metro and MahApps.Metro.Resources in each new WpfControlLibrary?
是的,你有。但这并没有看起来那么糟糕,相信我:
Visual Studio 使您可以选择管理整个解决方案的 NuGet 包。方法如下:
- 右键单击您的解决方案,然后 select
Manage NuGet Packages for Solution
- 此页面将打开:
您可以在此处轻松查看所有项目(在此解决方案中)上安装了哪些 NuGet 包、可用更新,甚至可以浏览以安装更多包。
如您所见,我 select 编辑了 MahApps.Metro 包,它向我显示版本 1.4.1 安装在 Helpers\SystemSpecs.Helpers
和 View\SystemSpecs.View
上(top-right 图片的一角)。
要在另一个项目上安装它,我所要做的就是 select 项目的 CheckBox 并单击 Install
。相同的过程适用于卸载它(除了您将单击 Uninstall
呵呵)。