Пример #1
0
        public RowList_Bindable_ReactiveList(BindableObject obj, BindableProperty prop)
        {
            _obj  = obj;
            _prop = prop;

            // this only listens for changes to the entire property.  like
            // when the entire IList<T> gets replaced.  it is primarily helpful
            // when we want to bind from a constructor but the property isn't set yet.
            obj.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) => {
                if (e.PropertyName == prop.PropertyName)
                {
                    ReactiveList <T> lst = (ReactiveList <T>)obj.GetValue(prop);
                    _next = new RowList_ReactiveList <T>(lst);
                    if (changed != null)
                    {
                        changed(this, null);
                    }
                    _next.changed += (object s2, CellCoords e2) => {;
                                                                    if (changed != null)
                                                                    {
                                                                        changed(this, e2);
                                                                    }
                    };
                }
            };
        }
        public RowList_Cache(IRowList <T> cd)
        {
            _cd = cd;

            _cd.changed += (object sender, CellCoords e) => {
                _cache.Remove(e.Row);
                if (changed != null)
                {
                    changed(this, e);
                }
            };
        }
        public ValuePerCell_RowList_Properties(IRowList <TRow> rows, Dictionary <int, string> map)
        {
            _rows = rows;
            _map  = map;

            rows.changed += (object sender, CellCoords e) => {
                if (changed != null)
                {
                    changed(this, e);
                }
            };
        }
        public ValuePerCell_RowList_Indexed(IRowList <TRow> rows)
        {
            _rows = rows;

            // TODO listen
        }