예제 #1
0
        public override void Connect()
        {
            var viewModelBinding = GetViewModelBinding();

            selectionPropertyBinder = new PropertyBinder(this.gameObject,
                                                         viewModelSelectionPropertyName,
                                                         uiSelectionPropertyName,
                                                         boundComponentType,
                                                         CreateAdapter(selectionViewModelToUIAdapter),
                                                         viewModelBinding.BoundViewModel);

            optionsPropertyBinder = new PropertyBinder(this.gameObject,
                                                       viewModelOptionsPropertyName,
                                                       uiOptionsPropertyName,
                                                       boundComponentType,
                                                       CreateAdapter(optionsAdapter),
                                                       viewModelBinding.BoundViewModel);

            selectionChangedEventBinder = new EventBinder(this.gameObject,
                                                          "set_" + viewModelSelectionPropertyName,
                                                          uiEventName,
                                                          boundComponentType,
                                                          CreateAdapter(selectionUIToViewModelAdapter),
                                                          viewModelBinding);
        }
예제 #2
0
 public override void Disconnect()
 {
     if (propertyBinder != null)
     {
         propertyBinder.Dispose();
         propertyBinder = null;
     }
 }
예제 #3
0
 public override void Connect()
 {
     propertyBinder = new PropertyBinder(this.gameObject,
                                         viewModelPropertyName,
                                         uiPropertyName,
                                         boundComponentType,
                                         CreateAdapter(adapterTypeName),
                                         GetViewModel());
 }
        public override void Connect()
        {
            var viewModelBinding = GetViewModelBinding();

            propertyBinder = new PropertyBinder(this.gameObject,
                                                viewModelPropertyName,
                                                uiPropertyName,
                                                boundComponentType,
                                                CreateAdapter(viewModelToUIAdapterName),
                                                viewModelBinding.BoundViewModel);

            eventBinder = new EventBinder(this.gameObject,
                                          "set_" + viewModelPropertyName, // Call the setter on the bound property
                                          uiEventName,
                                          boundComponentType,
                                          CreateAdapter(uiToViewModelAdapterName),
                                          viewModelBinding);
        }
예제 #5
0
        public override void Disconnect()
        {
            if (selectionPropertyBinder != null)
            {
                selectionPropertyBinder.Dispose();
                selectionPropertyBinder = null;
            }

            if (optionsPropertyBinder != null)
            {
                optionsPropertyBinder.Dispose();
                optionsPropertyBinder = null;
            }

            if (selectionChangedEventBinder != null)
            {
                selectionChangedEventBinder.Dispose();
                selectionChangedEventBinder = null;
            }
        }