Code: Select all
PageContainer.Child = new MyPage1();
Code: Select all
PageContainer.Child = new ProspectingPage();
Code: Select all
UriMapper uriMapper = new UriMapper();
UriMapping uriMapping = new UriMapping();
uriMapping.Uri = new Uri("/ProspectingPage", UriKind.Relative);
uriMapping.MappedUri = new Uri("/ProspectingPage.xaml", UriKind.Relative);
uriMapper.UriMappings.Add(uriMapping);
Code: Select all
public sealed partial class App : Application
{
public App()
{
this.InitializeComponent();
// Enter construction logic here...
var mainPage = new MainPage();
Window.Current.Content = mainPage;
}
}
Code: Select all
public sealed partial class App : Application
{
public App()
{
this.InitializeComponent();
// Enter construction logic here...
var frame = new Frame();
frame.Navigate(new Uri("MainPage.xaml", UriKind.Relative));
Window.Current.Content = frame;
}
}
Code: Select all
public sealed partial class App : Application
{
public Frame mFrame;
public App()
{
this.InitializeComponent();
// Enter construction logic here...
mFrame = new Frame();
mFrame.Navigate(new Uri("MainPage.xaml", UriKind.Relative));
Window.Current.Content = mFrame;
// var mainPage = new MainPage();
// Window.Current.Content = mainPage;
}
}
Code: Select all
public partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
// Enter construction logic here...
}
private void ProspectingButton_Click(object sender, RoutedEventArgs e)
{
((App)Application.Current).mFrame.Navigate(new Uri("ProspectingPage.xaml", UriKind.Relative));
}
}
ScottM wrote:If I want the user to be able to navigate away to a completely different web page (replacing the SPA), how can I do that?
Code: Select all
string uriString = "http://google.com";
CSHTML5.Interop.ExecuteJavaScript("window.location.href = $0", uriString);
Return to “General Discussion and Other”
Users browsing this forum: Bing [Bot] and 7 guests