WPF获取当前用户控件的父级窗体
时间:2019-04-19 11:34:54
收藏:0
阅读:599
方式一、通过当前控件名获取父级窗体 Window targetWindow = Window.GetWindow(button); 方式二、通过当前控件获取父级窗体 Window parentWindow = Window.GetWindow(this); 方式三、类--Application Window mainwin = Application.Current.MainWindow; MessageBox.Show(mainwin.Title, mainwin.Title);
原文:https://www.cnblogs.com/xunyiHe/p/10734697.html
评论(0)