private void EmailTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.CheckCurrent() && args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { _acvEmail.RefreshFilter(); } }
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- #endregion #region --Misc Methods (Private)-- private void UpdateFilter() { IsLoading = true; if (IsSmileysChecked) { EMOJI_SMILEYS_FILTERED.RefreshFilter(); } else if (IsPeopleChecked) { EMOJI_PEOPLE_FILTERED.RefreshFilter(); } else if (IsObjectsChecked) { EMOJI_OBJECTS_FILTERED.RefreshFilter(); } else if (IsSymbolsChecked) { EMOJI_SYMBOLS_FILTERED.RefreshFilter(); } else if (IsFoodChecked) { EMOJI_FOOD_FILTERED.RefreshFilter(); } else if (IsTransportationsChecked) { EMOJI_TRANSPORTATIONS_FILTERED.RefreshFilter(); } IsLoading = false; }
public VideoCommentSidePaneContentViewModel( VideoCommentPlayer commentPlayer, CommentFilteringFacade commentFiltering, Services.DialogService dialogService ) { CommentPlayer = commentPlayer; CommentFiltering = commentFiltering; _dialogService = dialogService; Comments = new AdvancedCollectionView(CommentPlayer.Comments, true); HandleCommentFilterConditionChanged(); void HandleCommentFilterConditionChanged() { #pragma warning disable IDISP004 // Don't ignore created IDisposable. new[] { Observable.FromEventPattern <CommentFilteringFacade.CommentOwnerIdFilteredEventArgs>( h => CommentFiltering.FilteringCommentOwnerIdAdded += h, h => CommentFiltering.FilteringCommentOwnerIdAdded -= h ).ToUnit(), Observable.FromEventPattern <CommentFilteringFacade.CommentOwnerIdFilteredEventArgs>( h => CommentFiltering.FilteringCommentOwnerIdRemoved += h, h => CommentFiltering.FilteringCommentOwnerIdRemoved -= h ).ToUnit(), Observable.FromEventPattern <CommentFilteringFacade.FilteringCommentTextKeywordEventArgs>( h => CommentFiltering.FilterKeywordAdded += h, h => CommentFiltering.FilterKeywordAdded -= h ).ToUnit(), Observable.FromEventPattern <CommentFilteringFacade.FilteringCommentTextKeywordEventArgs>( h => CommentFiltering.FilterKeywordUpdated += h, h => CommentFiltering.FilterKeywordUpdated -= h ).ToUnit(), Observable.FromEventPattern <CommentFilteringFacade.FilteringCommentTextKeywordEventArgs>( h => CommentFiltering.FilterKeywordRemoved += h, h => CommentFiltering.FilterKeywordRemoved -= h ).ToUnit(), } .Merge() .Subscribe(_ => Comments.RefreshFilter()) #pragma warning restore IDISP004 // Don't ignore created IDisposable. .AddTo(_disposables); using (Comments.DeferRefresh()) { Comments.SortDescriptions.Add(new SortDescription("VideoPosition", SortDirection.Ascending)); Comments.Filter = (c) => !isCommentFiltered(c as VideoComment); } } }
private void LoadEmoji(AdvancedCollectionView target, SortedSet <SingleEmoji>[] sources) { Task.Run(async() => { IsLoading = true; if (target.Source.Count <= 0) { SortedSet <SingleEmoji> result = sources[0]; for (int i = 1; i < sources.Length; i++) { result.Union(sources[i]); } List <SingleEmoji> emoji = result.Where((x) => x.HasGlyph).ToList(); await SharedUtils.CallDispatcherAsync(() => target.Source = emoji); } target.RefreshFilter(); SelectedList = target; IsLoading = false; }); }
public void Test_AdvancedCollectionView_Combined_Using_Shaping_Filter_Back_In() { var l = new ObservableCollection <Person> { new Person() { Name = "lorem", Age = 4 }, new Person() { Name = "imsum", Age = 8 }, new Person() { Name = "dolor", Age = 15 }, new Person() { Name = "sit", Age = 16 }, new Person() { Name = "amet", Age = 23 }, new Person() { Name = "consectetur", Age = 42 }, }; var a = new AdvancedCollectionView(l, true); a.Filter = (x) => ((Person)x).Name.Length > 5; a.RefreshFilter(); a.Filter = (x) => ((Person)x).Name.Length > 4; a.RefreshFilter(); a.SortDescriptions.Add(new SortDescription(nameof(Person.Age), SortDirection.Descending)); Assert.AreEqual(42, ((Person)a.First()).Age); Assert.AreEqual(4, a.Count); l.Add(new Person { Name = "foo", Age = 50 }); l.Add(new Person { Name = "Person McPersonface", Age = 10 }); Assert.AreEqual(42, ((Person)a.First()).Age); Assert.AreEqual(5, a.Count); }
private void FilteringTextBox_TextChanged_1(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { _advancedCollectionView.RefreshFilter(); }
public void RefreshFilter() { CHATS_ACV.RefreshFilter(); }