protected override void Configure(DynamicModelContainer <DebuggableValueModel> modelContainer,
                                      DynamicViewModelContainer <DebuggableValueViewModel>
                                      viewModelContainer,
                                      DebugViewContainer viewContainer,
                                      DebugService debugService,
                                      DebuggableValueViewFactory debuggableValueViewFactory)
    {
        viewModelContainer.BindContainer()
        .ToContainer(modelContainer,
                     model => ViewModelFactoryMethod(model, debugService));

        viewContainer.BindContainer().ToContainer(viewModelContainer,
                                                  vm => ViewFactoryMethod(
                                                      vm, debuggableValueViewFactory,
                                                      viewContainer.transform));
    }
Example #2
0
    protected override void Configure(DynamicModelContainer <TestModel> mContainer,
                                      DynamicViewModelContainer <TestViewModel> vmContainer,
                                      TestViewContainer vContainer,
                                      TestViewFactory factory)
    {
        Debug.Log("Configure " + nameof(TestDynamicViewConfiguration));

        // DEBUG REFLECTION LISTENING START ------------------------------------------------------------------------------
        //var propertyInfo =
        //    typeof(DynamicModelContainer<TestModel>).GetField("MutableCollection",
        //                                                         BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
        //var fieldInfoVm = typeof(DynamicViewModelContainer<TestViewModel>).GetField("MutableCollection",
        //                                                                    BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

        //if (fieldInfoVm == null || propertyInfo == null)
        //{
        //    Debug.LogError("PropertyInfo is null.");
        //}
        //else
        //{
        //    var mContainerProperty =
        //        (ObservableCollection<TestModel>)propertyInfo.GetValue(mContainer);

        //    var vmContainerProperty =
        //        (ObservableCollection<TestViewModel>)fieldInfoVm.GetValue(vmContainer);

        //    mContainerProperty.CollectionChanged += MockListenerModel;

        //    vmContainerProperty.CollectionChanged += MockListenerViewModel;
        //}

        //Debug.Log("MC Listeners: " + mContainer.Listeners.Count + " | Subscriptions: " + mContainer.Subscriptions.Count);
        //Debug.Log("VMC Listeners: " + vmContainer.Listeners.Count + " | Subscriptions: " + vmContainer.Subscriptions.Count);
        // DEBUG REFLECTION LISTENING END ---------------------------------------------------------------------------------------

        vmContainer.BindContainer().ToContainer(mContainer, m => TestVMFactory(m));

        vContainer.BindContainer().ToContainer(vmContainer,
                                               vm => TestViewFactory(
                                                   vm, factory,
                                                   vContainer.transform));
    }