在嵌套视图模型中监视事件的完整且最少的示例?

Complete and minimally sufficient example for monitoring events in nested view model?

我无法理解在我的嵌套视图模型中监视事件所需的全部内容(我认为这无关紧要,但我需要根据已填写的字段来控制嵌套 viewModel 中的焦点)。没有嵌套时一切正常,但当我尝试将其分解时,一切都无效。

我试图将以下内容拼凑起来,但仍在努力。是否有针对傻瓜的令人难以置信的详尽教程?

This one doesn't compile. Out dated?

https://github.com/Caliburn-Micro/Caliburn.Micro/issues/213

Caliburn.Micro nested ViewModels best practice

我这里有一个 parent 视图模型:

public EndUserUnloadViewModel(IEventAggregator eventAggregator)
        {
            this.eventAggregator = eventAggregator;
            this.eventAggregator.Subscribe(this);
            UnloaderRotaryVm = new UnloaderRotaryViewModel(eventAggregator);
            NotifyOfPropertyChange(() => UnloaderRotaryVm);
        }

查看:

  <DockPanel >

        <nsVi:UnloaderRotaryView DataContext="{Binding UnloaderRotaryVm, Mode=TwoWay}" HorizontalAlignment="Left"/>
        <!--<ContentControl Content="{Binding UnloaderRotaryVm}" />-->
        <!--cal:View.Model="{Binding UnloaderRotaryVm}"-->
    </DockPanel>

那么,这个在child

    public UnloaderRotaryViewModel(IEventAggregator eventAggregator) 
    {
        this.eventAggregator = eventAggregator;
        this.eventAggregator.Subscribe(this);
    }

那么,这个在国际奥委会

public static IContainer GetContainer()
        {
            var container = new Container(x =>
            {
               ...
                x.For<IEventAggregator>().Use<EventAggregator>().Singleton();
         ...}}

你能解释一下大局吗?你想创造什么? "unbelievably thorough tutorial for dummies out there?" - 为了什么?即 - "C for Dummies" , "Painting for Dummies"?

已解决! ViewModel 和 View 文件夹结构之间存在脱节。没有意识到这对于确定绑定很重要。

https://caliburnmicro.codeplex.com/wikipage?title=View/ViewModel%20Naming%20Conventions