简体   繁体   中英

Error loading XAML into frames

I have a XAML file in my app and I am trying to load other XAML files into it via the frame control however, its not working. I am getting an error Content for the URI is invalid . The error just pops up as a dialog error when I run the application so there is no stack trace available for it.

Below is the code for my "master page":

<navigation:Page x:Class="SilverAIM.BusinessCenter.BusinessCenterMaster" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="758" d:DesignHeight="480"
           Title="BusinessCenterMaster Page">
    <Grid x:Name="LayoutRoot">
        <navigation:Frame Height="100" HorizontalAlignment="Left"  Margin="0,248,0,0" Source="Test.xaml" Name="testFrame" VerticalAlignment="Top" Width="758" />
    </Grid>
</navigation:Page>

使用ContentControl而不是Frame使其正常工作。

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