3

この質問によると、ReactiveUI と CM を使用することは公園を散歩する必要があります: ReactiveUI と Caliburn Micro を一緒に使用しますか? しかし、私はすでにベイビーステップで苦労しています。

私はいつものセットアップで行きます:

ShellViewModel + ShellViewContentViewModel + ContentViewおよび単純なMEFBootstrapperのさまざまな形式です 。

また、Fody を使用して ReactiveUI の PropertyChanged と PropertyChanging を織り込んでいますが、Fody がなくてもエラーが発生します。

[Export]
public class ShellViewModel : ReactiveObject
{
    public ShellViewModel()
    {
        ActiveItem = new ContentViewModel();
    }
    public ContentViewModel ActiveItem { get; set; }
}

およびその XAML:

<Window x:Class="UiTest.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ShellView" Height="300" Width="300">
    <ContentControl x:Name="ActiveItem"></ContentPresenter>
</Window>

他の 2 つのファイルは、空のクラスとユーザー コントロールです。

アプリケーションの起動時に、ReactiveUI.Core で StackOverflowException が発生しました。これは、根本的に間違ったことをしているに違いないことを意味します。ちなみに、最新のドキュメントを持っている人がいれば、何らかの最新のドキュメントが欲しいです。

アップデート

RxUI 4.x を使用している場合ではなく、RxUI 5.x を使用している場合にのみエラーが発生します。MEF が不快であることは除外しました。ShellViewModel の代わりに ContentViewModel を ReactiveObject にすると、スタック オーバーフローが発生します。ちなみに、これはctorで発生します。カリバーンはまだ何も触れていないので、トピックのタイトルを変更する必要があると思います.

スタックトレース:

System.Reactive.Core.dll!System.Reactive.ObserverBase<System.Exception>.ObserverBase() + 0x23 bytes 
    System.Reactive.Core.dll!System.Reactive.AnonymousObserver<System.Exception>.AnonymousObserver(System.Action<System.Exception> onNext, System.Action<System.Exception> onError, System.Action onCompleted) + 0x38 bytes 
    System.Reactive.Core.dll!System.Reactive.AnonymousObserver<System.Exception>.AnonymousObserver(System.Action<System.Exception> onNext) + 0x4c bytes 
    System.Reactive.Core.dll!System.Reactive.Observer.Create<System.Exception>(System.Action<System.Exception> onNext) + 0xd4 bytes 
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xb9 bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes

...約100.000行後:

ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
The maximum number of stack frames supported by Visual Studio has been exceeded.    
4

1 に答える 1