public void RefreshViewList(ChangeType change = ChangeType.None) { var viewSize = _viewSize; var leading = _leading; var selected = _selected; bool isValidSelect = IsValidModel(selected); if (isValidSelect) { switch (change) { case ChangeType.OneUp: _buffer.Refresh(Items[0], viewSize, -1); break; case ChangeType.TwoUp: _buffer.Refresh(Items[0], viewSize, -2); break; case ChangeType.PageUp: _buffer.Refresh(Items[0], viewSize, -viewSize); break; case ChangeType.OneDown: _buffer.Refresh(Items[0], viewSize, 1); break; case ChangeType.TwoDown: _buffer.Refresh(Items[0], viewSize, 2); break; case ChangeType.PageDown: _buffer.Refresh(Items[0], viewSize, viewSize); break; case ChangeType.ToggleLeft: selected.ToggleLeft(Owner as Root); _buffer.Refresh(Items[0], viewSize, leading); break; case ChangeType.ToggleRight: selected.ToggleRight(Owner as Root); _buffer.Refresh(Items[0], viewSize, leading); break; case ChangeType.ToggleFilter: selected.IsFilterVisible = !selected.IsFilterVisible; break; case ChangeType.ViewListChanged: case ChangeType.FilterSortChanged: _buffer.Refresh(Items[0], viewSize, leading); break; } } PageControl?.Refresh(); }
/// <summary>Validate model against the model's item, return true if any child list changed</summary> internal void Validate() { var prev = new Dictionary <Item, LineModel>(); var viewListChanged = false; foreach (var model in Items) { viewListChanged |= model.Validate(Owner as Root, prev); } if (viewListChanged) { RefreshViewList(ChangeType.ViewListChanged); } else { PageControl?.Refresh(); } }