예제 #1
0
 public Driver(FastVerticallyScrollingItemViewer parent, IComparer <T> comparer)
 {
     this._parent     = parent;
     this._layoutTree = new PersistentAggregatingRedBlackTree <Unique <T>, ControlData, double>(
         (a1, k, v, a2) => a1 + v.Value.Type.Height + a2,
         Unique <T> .MakeComparerUnique(comparer));
     parent.scrollView.ViewChanged += (sender, arg) => UpdateShown();
     parent.scrollView.SizeChanged += (sender, arg) => {
         parent.layoutArea.Width = arg.NewSize.Width; // Warning: removing this may result in search results that drift right/left as they are manipulated by touch
         UpdateShown();
     };
 }
예제 #2
0
            public Unique <T> Add(T key, IVirtualControlValue value)
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }
                var uniqueKey = new Unique <T>(key);

                _layoutTree = _layoutTree.With(uniqueKey, new ControlData {
                    Value = value, Key = key
                }, overwrite: false);
                ScheduleUpdateShown();

                return(uniqueKey);
            }
예제 #3
0
 public void Clear()
 {
     _layoutTree = _layoutTree.WithEmpty();
     ScheduleUpdateShown();
 }
예제 #4
0
 public void Remove(Unique <T> key)
 {
     _layoutTree = _layoutTree.WithoutKey(key);
     ScheduleUpdateShown();
 }