Visual Studio 2017 工具箱中缺少许多 WPF 对象

Visual Studio 2017 Many WPF objects missing from the toolbox

我刚刚安装了 Visual Studio 2017 Enterprise 并为 .net 功能选择了 Desktop-Development。

现在,当我启动 Visual Studio 并创建一个新的 WPF 项目时,工具箱中没有高级对象,例如圆弧控件或除 BlurEffect 和 DropShadowEffect 之外的更多效果。这些和许多其他的只是失踪了。当我在 Visual Studio Blend 中查看对象浏览器时,我也在那里找不到它们。

我是否需要明确安装其他东西?

您可以右键单击工具箱中的某个类别,然后单击 "Choose items" 选项并尝试查找您缺少的工具:

visual studio 2010 toolbox standard controls missing

Blend 比 Visual Studio 设计更友好,所以如果您在 Blend 中看到更多选项,您应该不会感到惊讶。毕竟,Visual Studio 是一个 programming/coding 工具,而 Blend 是一个设计工具。

您很少(或从不)在“真实场景”中使用工具箱向 WPF 视图添加元素。事实上,完全禁用设计器是很常见的做法:http://blog.spinthemoose.com/2013/03/24/disable-the-xaml-designer-in-visual-studio/。如果您认真的 WPF 开发人员,您应该真正学习 XAML 和 MVVM :)

好的,我发现了:您必须在安装程序的“组件”部分中手动 select "Blend for Visual Studio SDK for .NET"。这实际上将安装所有我缺少的高级 WPF 控件。

那些总是从 VS 安装程序版本 2012、2013 和 2015 自动安装的(它是一个 100mb 的包)。

我可以想象,一个更加模块化的安装程序的想法让那里的设计者思考 "we need to make the installation faster so push out every little package that was used commonly throughout the last 5 years."。

然后他们想:"BUT hey, when it comes to the Xamarin installation, let's KEEP IN all the Google-Emulators for Android which pack a WHOPPING 17 GB!!!"

他们肯定也认为:"Most people wont need these, since they either have a android device on their own or they use one of our emulators, which are vtx enabled, so 10 times faster than googles emulators, and ours also only need 1 GB of disk-space. But well, we wanted to make a fast installer after all, so let it pack our customers drives full of stuff they don't need at all"。