Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows Phone 7.1 emulator不加载应用程序_C#_Xaml_Windows Phone 7_Emulation - Fatal编程技术网

C# Windows Phone 7.1 emulator不加载应用程序

C# Windows Phone 7.1 emulator不加载应用程序,c#,xaml,windows-phone-7,emulation,C#,Xaml,Windows Phone 7,Emulation,我目前正在开发我的第一个针对WindowsPhone7.1的应用程序,但似乎无法在模拟器中运行它。项目成功构建,但调试时模拟器屏幕保持黑色。似乎没有抛出异常,我可以让程序在断点处中断,尽管“局部变量”窗口中没有显示任何变量。我尝试了所有可用的模拟器,但都没有成功: Windows Phone仿真器-512 MB Windows Phone仿真器-256 MB Windows Phone Emulator 7.8 512 MB Windows Phone Emulator 7.8 256 MB

我目前正在开发我的第一个针对WindowsPhone7.1的应用程序,但似乎无法在模拟器中运行它。项目成功构建,但调试时模拟器屏幕保持黑色。似乎没有抛出异常,我可以让程序在断点处中断,尽管“局部变量”窗口中没有显示任何变量。我尝试了所有可用的模拟器,但都没有成功:

  • Windows Phone仿真器-512 MB
  • Windows Phone仿真器-256 MB
  • Windows Phone Emulator 7.8 512 MB
  • Windows Phone Emulator 7.8 256 MB
Interwebz上的另一篇帖子说,要确保在Configuration Manager中选中Build和Deploy框,我的框也被选中

My MainPage.xaml一点也不疯狂:

<phone:PhoneApplicationPage 
    x:Class="NationalParkGuide.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <!--Panorama control-->
        <controls:Panorama Title="national park guide">
            <controls:Panorama.Background>
                <ImageBrush ImageSource="Yosemite.jpg" />
            </controls:Panorama.Background>

            <!--Panorama item one-->
            <controls:PanoramaItem Header="menu">
                <!--Double line list with text wrapping-->
                <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="0,0,0,17" Width="432" Height="78">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <!--Use 'Orientation="Horizontal"' to enable a panel that lays out horizontally-->
            <controls:PanoramaItem Header="second item">
                <!--Double line list with image placeholder and text wrapping-->
                <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,17">
                                <!--Replace rectangle with image-->
                                <Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>
                                <StackPanel Width="311">
                                    <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                    <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
</phone:PhoneApplicationPage>
救命!:)

其他信息


我运行了dxdiag.exe,可以确认我满足7.1模拟器的要求。DirectX 11和WDDM 1.1。

检查您是否尚未在emulator上部署3个应用程序

请描述尝试运行emulator时发生的情况。应用程序很可能会崩溃。试着在Visual Studio中进行调试(F5),看看它能走多远。我已经更新了帖子来描述调试过程中发生的事情。我已经运行了您的代码,并且工作正常。。根据我的说法,这个代码没有错。要运行此程序,您的系统要求中一定存在一些问题。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace NationalParkGuide
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
            DataContext = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();
            }
        }
    }
}