简体   繁体   中英

Navigation in Windows Universal Apps 10 Not Working (Taking me to a blank page)

and thank you. I'm using Visual Studio 2015 and trying to navigate between 2 pages, MainPage.xaml and Meds.xaml On MainPage.xaml I put this button to navigate to Meds.xaml with.

 <Button x:Name="button_meds" Content="Meds" HorizontalAlignment="Left"     VerticalAlignment="Top" Margin="268,405,0,0" FontSize="18.667" Click="button_meds_Click"/>

In the MainPage.xaml.cs file, I simply did this

private void button_meds_Click(object sender, RoutedEventArgs e)
    {

        this.Frame.Navigate(typeof(Meds));

    }

Meds.xaml has an image and background, but I omitted the logo and grid from the code below

<Page
x:Class="SQLMobileMoodSwing.Meds"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SQLMobileMoodSwing"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
</Page>

I'm not getting any errors, but when I click the button, it simply takes me to a white page. Not sure what I'm doing wrong, have looked for solutions but nothing seems to work.

Thank you!

I have created Meds.xaml as XAML View, not as Blank Page. Then I deleted it and created again as a Blank Page and BOOM! It works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM