示例#1
0
 protected void AwakeBase(BindingContext.BindingContextMode bcm = BindingContext.BindingContextMode.MonoBinding, bool nameUnique = false)
 {
     if (!this.m_bInited)
     {
         this.m_bInited     = true;
         this.m_bNameUnique = nameUnique;
         this.DoWidgetToFullName();
         this.InitUI();
         if (bcm != BindingContext.BindingContextMode.None)
         {
             this.DataBinding();
             this.EventsBinding();
             this.BindingContextBinding(bcm);
         }
         base.AddListenersWhenAwake();
     }
 }
示例#2
0
    private void BindingContextBinding(BindingContext.BindingContextMode bcm)
    {
        if (bcm == BindingContext.BindingContextMode.None)
        {
            return;
        }
        BindingContext componentInParent = this.m_myTransform.GetComponentInParent <BindingContext>();

        if (componentInParent != null)
        {
            if (bcm == BindingContext.BindingContextMode.MonoBinding)
            {
                componentInParent.ViewModel = this.m_myTransform.GetComponentInParent <ViewModelBase>();
            }
            componentInParent.ContextMode = bcm;
            componentInParent.OnEnableSelf();
        }
    }