Exemple #1
0
 public void Unbind()
 {
     if (IsBound)
     {
         var otherBindingSite = _otherBindingSite;
         _otherBindingSite = null;
         otherBindingSite.Unbind();
     }
 }
Exemple #2
0
        public bool ForceBind(IBindingSite <TargetType, HostType> targetBindingSite)
        {
            if ((null == targetBindingSite) || targetBindingSite.IsBound)
            {
                return(false);
            }

            Unbind();
            return(Bind(targetBindingSite));
        }
Exemple #3
0
        public bool Bind(IBindingSite <TargetType, HostType> targetBindingSite)
        {
            if ((null == targetBindingSite) || targetBindingSite.IsBound || IsBound)
            {
                return(false);
            }

            _otherBindingSite = targetBindingSite;
            _otherBindingSite.BindBack(this);
            return(true);
        }
Exemple #4
0
 /// <summary>
 /// DO NOT CALL THIS METHOD DIRECTLY.  EXPOSED ONLY BECAUSE OF INTERFACE.
 /// When a binding is made against this site, a bind back will be made against the initiating site.
 /// </summary>
 /// <param name="targetBindingSite">The other binding site.</param>
 public void BindBack(IBindingSite <TargetType, HostType> targetBindingSite)
 {
     Debug.Assert(null != targetBindingSite);
     _otherBindingSite = targetBindingSite;
 }