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

时间:2014-11-04 06:55:14

标签: c# wpf xaml silverlight windows-phone-8

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

ERROR:

{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:

<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>

0 个答案:

没有答案