Ejemplo n.º 1
0
 public void Bind(IBindingProperty prop)
 {
     if (prop is IBindingProperty <IMessenger> target)
     {
         m_Prop = target;
     }
 }
Ejemplo n.º 2
0
 public void Unbind(IBindingProperty prop)
 {
     if (prop == m_Prop)
     {
         m_Prop = null;
     }
 }
Ejemplo n.º 3
0
 void IBindable.Unbind(IBindingProperty prop)
 {
     if (m_Property == prop)
     {
         m_Property = null;
     }
 }
Ejemplo n.º 4
0
 public virtual bool Unbind(IBindingProperty property)
 {
     if (m_Input == property)
     {
         m_Input  = null;
         m_Output = null;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
        public virtual bool TryConvert <T>(IBindingProperty property, ref IBindingProperty <T> output)
        {
            IBindingProperty ret = null;

            if (TryConvert(property, ref ret) && ret is IBindingProperty <T> target)
            {
                output = target;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 6
0
        public void SetSource(object source)
        {
            data = source;

            bindingProperty = data as IBindingProperty;
            bindingHandler  = bindingProperty?.Subscribe(OnValueChange);

            array       = data as Array;
            dynamicData = data as IDynamicDataSource;
            list        = data as IList;
            dictionary  = data as IDictionary;
        }
Ejemplo n.º 7
0
 void IBindable.Unbind(IBindingProperty prop)
 {
     if (m_Converter != null && m_Converter.Unbind(prop))
     {
         m_Property = null;
         OnUnbind();
     }
     if (m_Property == prop)
     {
         m_Property = null;
         OnUnbind();
     }
 }
Ejemplo n.º 8
0
        void IBindable.Bind(IBindingProperty prop)
        {
            IBindingProperty ret = null;

            if (m_Converter.TryConvert(prop, ref ret) && ret.IsAssignable <IViewModel>())
            {
                m_Property = ret;
                return;
            }
            if (prop.IsAssignable <IViewModel>())
            {
                m_Property = prop;
            }
        }
Ejemplo n.º 9
0
 void Unbind(string path, IBindingProperty prop)
 {
     if (m_Disposed)
     {
         return;
     }
     for (int i = 0; i < m_BindingCount; i++)
     {
         IBindable bind = m_Binding[i];
         if (bind.Path == path && bind.IsActive)
         {
             bind.Unbind(prop);
         }
     }
 }
Ejemplo n.º 10
0
        void IBindable.Bind(IBindingProperty prop)
        {
            var conv = GetConverter();

            if (conv != null && conv.TryConvert(prop, ref m_Property))
            {
                m_ForceUpdate = true;
                return;
            }
            if (prop is IBindingProperty <T> ret)
            {
                m_Property    = ret;
                m_ForceUpdate = true;
            }
        }
Ejemplo n.º 11
0
        void IBindable.Bind(IBindingProperty prop)
        {
            var conv             = GetConverter();
            IBindingProperty ret = null;

            if (conv != null && conv.TryConvert(prop, ref ret) && ret.IsAssignable <T>())
            {
                m_Property    = ret;
                m_ForceUpdate = true;
                return;
            }
            if (prop.IsAssignable <T>())
            {
                m_Property    = prop;
                m_ForceUpdate = true;
            }
        }
Ejemplo n.º 12
0
        public virtual bool TryConvert(IBindingProperty property, ref IBindingProperty output)
        {
            var input = property as IBindingProperty <TInput>;

            if (input == null)
            {
                return(false);
            }
            m_ForceUpdate = true;
            if (m_Output == null)
            {
                m_Output            = new ConvertProperty <UOutput>(input.Path);
                m_Output.OnChanged += OnChanged;
            }
            m_Input = input;
            TryUpdate();
            output = m_Output;
            return(true);
        }
Ejemplo n.º 13
0
 void IBindable.Bind(IBindingProperty prop)
 {
     m_Property = prop;
 }