C# 在Windows Phone应用程序中创建主视图

C# 在Windows Phone应用程序中创建主视图,c#,wpf,xaml,silverlight,windows-phone-8,C#,Wpf,Xaml,Silverlight,Windows Phone 8,我正在创建一个主视图,其中所有视图都将为此导航。我创建了一个简单的Xaml页面,并在其中添加了一个TransitionFrame,然后在此框架中导航其他页面。但当我的应用程序启动并导航到MasterView时,它会崩溃,并出现以下错误: 错误: {System.Windows.Markup.XamlParseException: Cannot create instance of type 'Microsoft.Phone.Controls.TransitionFrame' [Line: 32

我正在创建一个主视图,其中所有视图都将为此导航。我创建了一个简单的Xaml页面,并在其中添加了一个TransitionFrame,然后在此框架中导航其他页面。但当我的应用程序启动并导航到MasterView时,它会崩溃,并出现以下错误:

错误:

{System.Windows.Markup.XamlParseException: Cannot create instance of type 'Microsoft.Phone.Controls.TransitionFrame' [Line: 32 Position: 22] ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Microsoft.Phone.Controls.PhoneApplicationFrame..ctor()
   at Microsoft.Phone.Controls.TransitionFrame..ctor()
   --- End of inner exception stack trace ---
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at View.MasterView.InitializeComponent()
   at View.MasterView..ctor()}
XAML:



您能为toolkit显示您的XAML usings语句吗?如果执行此instead,会发生什么@Scott Nimrod-我需要使用框架在母版页中添加页面。这样,我就可以在导航服务中获取母版页的框架,并使用它导航到其他页面。
<Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,0">
            <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <toolkit:TransitionFrame
            x:Name="MasterFrame"
            Grid.Row="1" >

        </toolkit:TransitionFrame>
    </Grid>