Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的设置非常简单。我有MainWindow.xaml哪个加载“取消隐藏”Frame1显示Page1.xaml。
MainWindow.xaml
Frame1
Page1.xaml
我有一个按钮Page1.xaml。我如何使用按钮单击事件(Page1)来关闭或隐藏Page1.xaml & Frame1,将用户视图返回到MainWindow.xaml(内容)?
Page1.xaml & Frame1
您可以像这样在主页上获得句柄:
Dim mainPage As MainWindow = TryCast(Application.Current.MainWindow, MainWindow) If mainPage IsNot Nothing The mainPage.frame1.Visibility = Visibility.Collapsed