public void Startup() { initial_data = new List <int>() { 5, 10, 212 }; source = new ObservableCollection <int>(initial_data); filterer = new ObservableCollectionFilter <int>(source); results = filterer.FilteredResults; }
public MainViewModel(ItemReportStorage item_report_storage, IGeolocator geolocator) { this.ItemReportStorage = item_report_storage; this.Geolocator = geolocator; this.Title = "Salvage It"; Filter = new ObservableCollectionFilter <ItemReport>( item_report_storage.LocalItemReports); this.LocalItemReports = Filter.FilteredResults; RefreshActionAsync(); }
public void Filter_StrictFilter_FiltersInitialData() { filterer = new ObservableCollectionFilter <int>(source, i => i < 100); results = filterer.FilteredResults; CollectionAssert.AreEquivalent( new List <int>() { 5, 10 }, results); }
public NewsArticlesPage( DatabaseContext dbContext, ObservableCollection <NewsArticle> allNewsArticles, IEnumerable <ExtensionFeature <INewsFilterExtension> > newsFilterExtensionFeatures, IEnumerable <ExtensionFeature <INewsSharerExtension> > newsSharerExtensionFeatures) { InitializeComponent(); _dbContext = dbContext; NewsArticleFilter = new ObservableCollectionFilter <NewsArticle>(allNewsArticles, (na) => !na.Hidden); NewsArticlesSource = NewsArticleFilter.FilteredResults; NewsArticlesDataGrid.ItemsSource = NewsArticleFilter.FilteredResults; this.NewsFilterExtensionFeatures = newsFilterExtensionFeatures; this.NewsSharerExtensionFeatures = newsSharerExtensionFeatures; InitializeDataGridRowContextMenuAll(); }