Silverlight - How to navigate from a User Control to a normal page?

前端 未结 8 1221
南旧
南旧 2020-12-09 18:13

If I do this inside a User Control:

NavigationService.Navigate(new Uri(\"/Alliance.xaml\", UriKind.Relative));

it says this error:

8条回答
  •  感情败类
    2020-12-09 18:31

    Here is another solution for Silverlight for Windows Phone 8:

    public Page Page { get; set; }
    

    this.Loaded += delegate
    {
        Page = (Application.Current.RootVisual as Frame).Content as Page;
    };
    

    Page.NavigationService.Navigate(new Uri("/Alliance.xaml", UriKind.Relative));
    

提交回复
热议问题