protected SelectionList([NotNull] BaseAcManager <TObject> manager, bool isCacheable) { if (manager == null) { throw new ArgumentNullException(nameof(manager)); } TextSearch.SetTextPath(this, nameof(SelectCategoryBase.DisplayName)); ScrollViewer.SetHorizontalScrollBarVisibility(this, ScrollBarVisibility.Disabled); ScrollViewer.SetCanContentScroll(this, true); var baseLey = $@".SelectionList:{typeof(TObject).FullName}:{typeof(TItem).FullName}"; _scrollKey = $@"{baseLey}:Scroll"; _cacheKey = isCacheable ? $@"{baseLey}:Items" : null; _manager = manager; _baseCollection = manager.WrappersList; _items = new BetterObservableCollection <TItem>(Rebuild()); if (!manager.IsLoaded) { EnsureLoaded(isCacheable).Forget(); } Loaded += OnLoaded; Unloaded += OnUnloaded; PreviewKeyDown += OnPreviewKeyDown; }
public AcEnabledOnlyCollection_WrappedImpl(IAcWrapperObservableCollection collection) { _wrapped = new DelegateWrappedCollection <AcItemWrapper, T>((IReadOnlyList <AcItemWrapper>)collection, x => x.Value.Enabled ? x.Value as T : null); _view = new BetterListCollectionView(_wrapped) { Filter = o => o != null }; collection.WrappedValueChanged += OnWrappedValueChanged; }
public void OnUri(Uri uri) { Title = uri.GetQueryParam("Title"); var type = uri.GetQueryParam("Type"); MainList = type == @"track" ? TracksManager.Instance.WrappersList : type == @"car" ? CarsManager.Instance.WrappersList : type == @"showroom" ? ShowroomsManager.Instance.WrappersList : null; Filter = uri.GetQueryParam("Filter"); DataContext = this; InitializeComponent(); List.UserFiltersKey = $@"AcObjectListBox:FiltersHistory:{type}"; SaveScroll.SetKey(List, $@".AcObjectSelectList.scroll:{type}:{Filter}"); }
public AcEnabledOnlyCollection(IAcWrapperObservableCollection collection) : base(collection) { }
public AcEnabledOnlyCollection_ThirdImpl([NotNull] IAcWrapperObservableCollection collection) : base((IReadOnlyList <AcItemWrapper>)collection) { collection.WrappedValueChanged += OnWrappedValueChanged; }
internal AcEnabledOnlyCollection(IAcWrapperObservableCollection collection) : base(collection.Select(x => x.Value).Where(x => x.Enabled).OfType <T>()) { _collection = collection; collection.CollectionChanged += Collection_CollectionChanged; collection.WrappedValueChanged += Collection_WrappedValueChanged; }