From 195a4a993f219197100ab6393fd694552bdca604 Mon Sep 17 00:00:00 2001 From: bricefriha Date: Tue, 4 Aug 2026 20:59:34 +0100 Subject: [PATCH 1/8] deals | add search bar UI --- App/Views/DealsPage.xaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/App/Views/DealsPage.xaml b/App/Views/DealsPage.xaml index c729bba5..42ce8736 100644 --- a/App/Views/DealsPage.xaml +++ b/App/Views/DealsPage.xaml @@ -60,6 +60,11 @@ ItemsSource="{Binding Deals}" Margin="1,0" > + + + + + From 187cca4aea8f48c91cc46012f71ed319bcc203e5 Mon Sep 17 00:00:00 2001 From: bricefriha Date: Tue, 4 Aug 2026 22:06:39 +0100 Subject: [PATCH 2/8] search kinda working i guess --- App/ViewModels/DealsViewModel.cs | 26 +++++++++++++++++++++++++- App/Views/DealsPage.xaml | 8 +++++++- App/Views/DealsPage.xaml.cs | 7 +++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/App/ViewModels/DealsViewModel.cs b/App/ViewModels/DealsViewModel.cs index 510d88d7..0e8561ff 100644 --- a/App/ViewModels/DealsViewModel.cs +++ b/App/ViewModels/DealsViewModel.cs @@ -10,6 +10,7 @@ public class DealsViewModel : BaseViewModel { public App CurrentApp { get; } private ObservableRangeCollection _deals = new (); + private ObservableRangeCollection _presearchDeals; public ObservableRangeCollection Deals { @@ -97,7 +98,7 @@ public DealsViewModel() CurrentApp.DataFetcher.AllDeals.Where(deal => deal?.DRM != null && allowedDrms.Contains(deal.DRM) ).OrderBy(d => d.Expires); - Deals = new ObservableRangeCollection( + _presearchDeals = Deals = new ObservableRangeCollection( filtersList); FiltersApplied = true; @@ -140,6 +141,26 @@ public ObservableCollection Platforms } + public void DealsSearch(string textSearch) + { + if (string.IsNullOrEmpty(textSearch)) + { + + Deals = _presearchDeals; + return; + } + + var filteredDeals = _presearchDeals.Where(deal => deal.Title.ToLower().Contains(textSearch.ToLower()))?.ToList(); + + if (filteredDeals is null) + { + Deals = _presearchDeals; + return; + } + + Deals = new(filteredDeals); + } + public async Task UpdateDeals() { if (!(Deals?.Count > 0)) @@ -196,6 +217,8 @@ await MainThread.InvokeOnMainThreadAsync(() => IsLoading = false; _setup = true; + + _presearchDeals = _deals; return; } IsLoading = false; @@ -220,5 +243,6 @@ await MainThread.InvokeOnMainThreadAsync(() => Deals.RemoveAt(i); } + _presearchDeals = _deals; } } diff --git a/App/Views/DealsPage.xaml b/App/Views/DealsPage.xaml index 42ce8736..afed573c 100644 --- a/App/Views/DealsPage.xaml +++ b/App/Views/DealsPage.xaml @@ -62,7 +62,13 @@ > - + diff --git a/App/Views/DealsPage.xaml.cs b/App/Views/DealsPage.xaml.cs index 4b29df28..2d7f6a2a 100644 --- a/App/Views/DealsPage.xaml.cs +++ b/App/Views/DealsPage.xaml.cs @@ -40,4 +40,11 @@ public void Resume() { _vm.UpdateDeals().GetAwaiter(); } + + private void search_SearchButtonPressed(object sender, EventArgs e) + { + _vm.DealsSearch(search.Text); + search.Unfocus(); + + } } \ No newline at end of file From cf30ef2b4ac1b14d3ebcad23726c8d50a929af9d Mon Sep 17 00:00:00 2001 From: bricefriha Date: Sun, 23 Aug 2026 14:34:11 +0100 Subject: [PATCH 3/8] Create a deal preview controller --- App/Controls/DealPreview.xaml | 206 +++++++++++++++++++++++++++++++ App/Controls/DealPreview.xaml.cs | 22 ++++ App/Views/DealsPage.xaml | 2 +- 3 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 App/Controls/DealPreview.xaml create mode 100644 App/Controls/DealPreview.xaml.cs diff --git a/App/Controls/DealPreview.xaml b/App/Controls/DealPreview.xaml new file mode 100644 index 00000000..11d29acf --- /dev/null +++ b/App/Controls/DealPreview.xaml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +