問題がでロードに失敗しました "は、ページのロードに失敗しました"。私はこのDIを削除する場合、私のツールは正常に動作します。 Btw、IHelloServiceはこのエラーを表示しません。それだけでうまく動作しますIMvxMessanger。MvvmCross、UWP、MessengerPlugin:私はViewModelに</em><em>に<em>IMvxMessanger</em>のコンストラクタDIを追加したとき、私はエラーを得た:ページ
私は、このマニュアルに従っ:https://mvvmcross.com/docs/a-windows-universal-app-platform-project
MvvmCrossバージョン:4.4.0
コード例:
FirstViewModel
public class FirstViewModel : MvxViewModel
{
private readonly IHelloService _helloService;
private readonly IMvxMessenger _messenger;
public FirstViewModel(IHelloService helloService, IMvxMessenger messenger)
{
_helloService = helloService;
_messenger = messenger;
}
private string _hello = "Hello MvvmCross";
public string Hello
{
get { return _hello; }
set { SetProperty(ref _hello, value); }
}
}
FirstView.xaml.cs
をFirstView.xaml
<views:MvxWindowsPage
x:Class="MvvmCrossDocs.UWP.Views.FirstView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MvvmCrossDocs.UWP.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:MvvmCross.WindowsUWP.Views"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<TextBox Text="{Binding Hello, Mode=TwoWay}" />
<TextBlock Text="{Binding Hello}" />
</StackPanel>
</Grid>
セットアップ
public class Setup : MvxWindowsSetup
{
public Setup(Frame rootFrame) : base(rootFrame)
{
}
protected override IMvxApplication CreateApp()
{
return new Core.App();
}
}
またApp.xaml.cs
if (rootFrame.Content == null)
{
var setup = new Setup(rootFrame);
setup.Initialize();
var start = Mvx.Resolve<IMvxAppStart>();
start.Start();
}
Droidプロジェクトから_Bootstrap_フォルダをコピーして名前空間を変更しました - > 0変更すると、同じエラーが発生しました。 –
また、私は_Sturtup.cs_ファイルで 'InitializeLastChance'を試しました。また、同じエラー:( –
Hmmm、興味深い例外のスタックトレースがありますか?クリーンで再構築を試したことがありますか? – Plac3Hold3r