如何在 BlendDesigner 中将 UserControl 添加到窗口?

发布于 2024-09-13 01:53:22 字数 125 浏览 2 评论 0原文

一般来说,我是使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

场罚期间 2024-09-20 01:53:22

在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文