Skip to content

Commit

Permalink
Fix notices double load
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabboxl committed Mar 25, 2024
1 parent afd9fdd commit 4be5dc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ClassevivaPCTO/Views/BachecaPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ await CoreApplication.MainView.Dispatcher.RunAsync(

var noticeCategories = noticesToShow.Select(n => n.cntCategory).Distinct().Where(c => !string.IsNullOrEmpty(c)).OrderBy(o => o).ToList();

noticeCategories.Insert(0, "Tutte le categorie");

if (!string.IsNullOrEmpty(selectedCategory))
{
noticeCategories.Insert(0, "Tutte le categorie");
noticesToShow = noticesToShow.Where(n => n.cntCategory == selectedCategory).ToList();
}

Expand Down Expand Up @@ -155,6 +154,10 @@ public override async void AggiornaAction()

private void CategoryComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
ComboBox comboBox = (ComboBox) sender;
if (comboBox.SelectedIndex == -1)
return;

AggiornaAction();
}

Expand Down

0 comments on commit 4be5dc8

Please sign in to comment.