[英]How can I vertically stretch a WPF user control and its components while stretching its parent window
[英]how can i get the parent of user control wpf
我有一個問題,我做一個窗口應用程序,並在我的窗口窗體上使用一些Wpf用戶控件我要關閉我的窗體當我關閉用戶控件,取消按鈕我怎么能得到它.....意味着我想得到usercontrol的父級
使用Parent
-property獲得的UserControl
的Parent
。 您可以直接使用Window.GetWindow
-method獲取的窗口。
Window w=Window.GetWindow(this);
if(null != w){
w.Close();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.