public void Bind(IBindingProperty prop) { if (prop is IBindingProperty <IMessenger> target) { m_Prop = target; } }
public void Unbind(IBindingProperty prop) { if (prop == m_Prop) { m_Prop = null; } }
void IBindable.Unbind(IBindingProperty prop) { if (m_Property == prop) { m_Property = null; } }
public virtual bool Unbind(IBindingProperty property) { if (m_Input == property) { m_Input = null; m_Output = null; return(true); } return(false); }
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); }
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; }
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(); } }
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; } }
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); } } }
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; } }
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; } }
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); }
void IBindable.Bind(IBindingProperty prop) { m_Property = prop; }