Usercontrol无法正常工作

时间:2014-11-13 08:34:55

标签: c# asp.net windows-phone-8 user-controls

我在wp8中创建了一个弹出窗口,其中另一个用户控件我在代码下方的按钮上调用此弹出窗口

private void Button_Click(object sender, RoutedEventArgs e)
{
        Mypopup.VerticalOffset = 100;


        if (Mypopup.IsOpen != true)
        {
            Mypopup.Child = Mycontrol;
            Mypopup.IsOpen = true;
        }
        else
        {
            Mypopup.IsOpen = false;
        }

        Mycontrol.Settings.Click += (s, args) =>
            {
                Mycontrol.Settings.NavigateUri = new Uri("/SelectJokeType.xaml", UriKind.RelativeOrAbsolute);
            };      
 }

但NavigateUri无法正常运行它不会去Selectjoketype.xaml页面

2 个答案:

答案 0 :(得分:0)

NavigationService.Navigate怎么样?其他信息here

答案 1 :(得分:0)

以下是适用于Windows Phone 8的Silverlight解决方案:

 public Page Page { get; set; }
 this.Loaded += delegate
{
    Page = (Application.Current.RootVisual as Frame).Content as Page;
};
Page.NavigationService.Navigate(new Uri("/mainpage.xaml", UriKind.Relative));