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.
我有一个用户控件。当我单击此用户控件中的按钮时,我需要导航到另一个 xaml 页面。我该怎么做?
在您的用户控件中使用它。
<Frame NavigationUIVisibility="Hidden" Name="ContentFrame" />
一旦用户执行按钮单击动作,c# 代码事件函数就会被触发。在该功能中使用此功能转到您喜欢的页面
Page page = new Page() Dispatcher.Invoke(() => { this.ContentFrame.Navigate(page); });