如何关闭用户控制 [英] how to close user control

查看:160
本文介绍了如何关闭用户控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了登录模块作为用户控件.我在两个地方使用登录用户控件,其中一个窗口是模型对话框.

我在用户控件中有登录"按钮.我需要基于成功登录关闭模态对话框"窗口.

I have created login module as user control.I am using login user control in two places where in one window is model dialog.

I have SignIn button in User Control. I need to close the Modal Dialog window based on successful login. How to implement this in WPF?

推荐答案

Control没有关闭"这样的概念.模态对话框由用户关闭,您无需关闭它.通常,使用System.Windows.Window.Close关闭窗口,请参见 http://msdn.microsoft. com/en-us/library/system.windows.window.aspx [ ^ ].

—SA
There is no such concept for the Control as "close". Modal dialog is closed by the user, you don''t need to close it. Generally, a Window is closed using System.Windows.Window.Close, see http://msdn.microsoft.com/en-us/library/system.windows.window.aspx[^].

—SA


这篇关于如何关闭用户控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆