如何在 BlendDesigner 中将 UserControl 添加到窗口?
一般来说,我是使用 Blend 和 WPF 的初学者。我创建了三个用户控件。我还创建了一个应该容纳用户控件的窗口。
是否有任何设计器方法,例如将用户控件拖放到窗口中,使其自动显示?或者输入 XAML 是包含它的唯一方法?
I am a beginner in using Blend and WPF in general. I created three user controls. I also created a Window which should house the user controls.
Is there any designer way, like drag dropping the user control into the Window which will make it appear automatically?. Or typing in the XAML is the only way to include it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Blend 工具栏的底部(垂直方向的工具和控件列表 - 默认情况下位于左侧),有一个看起来像向右的 V 形/箭头的按钮。
单击此按钮将展开您可以使用的控件列表。您可以浏览,但默认情况下您的光标现在将位于搜索框中。输入控件名称的前几个字母,您应该会看到它出现。单击它。
现在,您可以在工具栏的最底部进行控制。将鼠标悬停在其上即可查看名称和说明(如果有)。
在“对象和时间轴”窗格中,选择要添加控件的窗口或面板,然后双击工具栏底部的该按钮。
或者,您可以将控件拖放到表单或“对象和时间轴”窗格中。
At the bottom of your Blend toolbar (the vertically-oriented list of tools and controls -- on the left, by default), there is a button that looks like right-facing chevrons/arrow.
Clicking this will expand the list of controls at your disposal. You can browse, but by default your cursor will now be in a search box. Type the first few letters of your control name, and you should see it appear. Click it.
Now, at the very bottom of the toolbar, should be your control. Hover your mouse over it to see the name and description, if any.
In the Objects and Timeline pane, select the window or panel to which you want the control added, and then double-click that button at the bottom of the toolbar.
Alternatively, you can drag-and-drop the control into your form or into the Objects and Timeline pane.