如何从页面关闭 silverlight 中的 ChildWindow?

发布于 2024-10-05 01:13:41 字数 98 浏览 0 评论 0原文

我有 page.xaml 和 childwindow。我如何从 page.xaml 关闭子窗口。单击 page.xaml 中的按钮示例。我如何从代码中获取这个childWindow?

I have page.xaml and childwindow. How i can close the childwindow from page.xaml. Example by click on button in page.xaml. How i can get this childWindow from code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

一片旧的回忆 2024-10-12 01:13:42

将您的 ChildWindow 示例命名为 x:Name="myChildWindow" 在您的 page.xaml 按钮单击事件中将其放在后面的代码中

myChildWindow.Close();

Name your ChildWindow example x:Name="myChildWindow" under your page.xaml button click event in your code behind put this

myChildWindow.Close();
澉约 2024-10-12 01:13:42

我相信 ChildWindow 对象上有一个 Close 方法。通过调用该方法,窗口将关闭。

请参阅 MSDN文档。

I believe there is a Close method on the ChildWindow object. By calling this method, the window will close.

See the MSDN documentation.

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