2016-11-05 1 views
1

Ich habe eine Ausnahme bei der Bereitstellung einer einfachen Prism.Mvvm App auf Mobile Emulator 10586, während es auf Simulator sowie auf meinem lokalen Computer funktioniert. ich Prism.storeapps package.Here bin Referenzierung ist mein CodePrism-Mvvm App-Bereitstellung Fehler auf Mobile Emulator

App.xaml.cs

namespace MvvmSample 
{ 
    sealed partial class App : MvvmAppBase 
    { 
     public App() 
     { 
      InitializeComponent(); 
     } 
     public enum Expirences 
     { 
      Main 
     } 
     protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args) 
     { 
      this.NavigationService.Navigate(Expirences.Main.ToString(), null); 
      return Task.FromResult<object>(null); 
     } 

    } 
} 

MainPage.xaml

<controls:PageBase 
    x:Class="MvvmSample.Views.MainPage" 
    xmlns:controls="using:MvvmSample.Controls" 
    xmlns:prism="using:Microsoft.Practices.Prism.Mvvm" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:MvvmSample" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    prism:ViewModelLocator.AutoWireViewModel="True" 
    mc:Ignorable="d"> 
    <d:Page.DataContext> 
     <local:MainPageViewModel/> 
    </d:Page.DataContext> 
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
     <TextBlock Text="{Binding Title}" FontSize="29.333" /> 
    </Grid> 
</controls:PageBase> 

Ansicht

namespace MvvmSample 
{ 
    namespace Controls 
    { 
     public abstract partial class PageBase : Page, IView { } 
    } 
    namespace Views 
    { 
     public sealed partial class MainPage : Controls.PageBase 
     { 
      public MainPage() 
      { 
       this.InitializeComponent(); 
      } 
     } 
    } 
    namespace ViewModels 
    { 
     public class MainPageViewModel : Microsoft.Practices.Prism.Mvvm.ViewModel 
     { 
      public string Title { get; set; } 
      public MainPageViewModel() 
      { 
       this.Title = "Run Time"; 
      } 
     } 
    } 
} 
+0

Was bedeutet der Bereitstellungsfehler? –

Antwort

1

Sie‘ Verwenden Sie Prism.StoreApps, das ist ein Paket für Windows 8.1. Für UWP sollten Sie Prism.Windows verwenden. Der Grund, warum es auf Ihrem Computer funktioniert, ist, weil Windows 10 Windows 8-Anwendungen ausführen kann. Während der Emulator ein spezifischer SDK-Build ist.

Weitere Informationen zu den verfügbaren NuGet-Paketen für Windows 10 (einschließlich Dependency-Injektion) finden Sie unter official GitHub repo. Es gibt auch einige Beispiele in this repo.