예제 #1
0
        internal static IBindableView GetBindableView(BindingGroup group)
        {
            WeakReference <IBindableView> weakReference = null;

            BindableViews.TryGetValue(group.Id, out weakReference);
            return(weakReference?.GetOrDefault());
        }
예제 #2
0
 public Binding(BindingGroup bindingGroup)
 {
     this.BindingGroup = bindingGroup ?? new BindingGroup();
     this.Id           = IdPool.Next();
     Bindings.Add(this.BindingGroup);
     this.BindingGroup.Add(this);
 }
예제 #3
0
        internal static void Remove(BindingGroup group)
        {
            if (group != null && group.Id > 0)
            {
                var id = group.Id;
                AllBindingGroups.Remove(id);
                BindableViews.Remove(id);

                IdPool.Recycle(id);
                group.Id = 0;
            }
        }
예제 #4
0
        internal static void Add(BindingGroup group)
        {
            if (group != null)
            {
                if (group.Id == 0)
                {
                    group.Id = IdPool.Next();
                }

                AllBindingGroups[group.Id] = group;
            }
        }
예제 #5
0
 public Binding(TSource source, TTarget target, BindingGroup bindingChain = null) :
     base(bindingChain)
 {
     this.weakSource = new WeakReference <TSource>(source);
     this.weakTarget = new WeakReference <TTarget>(target);
 }
예제 #6
0
 internal static void SetBindableView(BindingGroup group, IBindableView bindableView)
 {
     BindableViews[group.Id] = new WeakReference <IBindableView>(bindableView);
 }