UI: Fix sort timing

- Now sorts instantly when an option is selected

Co-authored-by: _Neo_ <ursamajorjanus2819@gmail.com>
This commit is contained in:
KeatonTheBot
2026-08-10 00:00:49 -05:00
co-authored by _Neo_
parent cc1861f9bb
commit d1fb89f746
4 changed files with 10 additions and 14 deletions
@@ -161,13 +161,13 @@
IsCheckedChanged="Order_Checked"
Content="{locale:Locale OrderAscending}"
GroupName="Order"
IsChecked="{Binding IsAscending, Mode=OneTime}"
IsChecked="{Binding IsAscending, Mode=TwoWay}"
Tag="Ascending" />
<RadioButton
IsCheckedChanged="Order_Checked"
Content="{locale:Locale OrderDescending}"
GroupName="Order"
IsChecked="{Binding !IsAscending, Mode=OneTime}"
IsChecked="{Binding !IsAscending, Mode=TwoWay}"
Tag="Descending" />
</StackPanel>
</Flyout>
@@ -32,18 +32,14 @@ namespace Ryujinx.Ava.UI.Views.Main
public void Sort_Checked(object sender, RoutedEventArgs args)
{
if (sender is RadioButton button)
{
ViewModel.Sort(Enum.Parse<ApplicationSort>(button.Tag?.ToString() ?? string.Empty));
}
if (sender is RadioButton { IsChecked: true, Tag: string sortStrategy })
ViewModel.Sort(Enum.Parse<ApplicationSort>(sortStrategy));
}
public void Order_Checked(object sender, RoutedEventArgs args)
{
if (sender is RadioButton button)
{
ViewModel.Sort(button.Tag?.ToString() != "Descending");
}
if (sender is RadioButton { IsChecked: true, Tag: string sortOrder })
ViewModel.Sort(sortOrder is not "Descending");
}
private void SearchBox_OnKeyUp(object sender, KeyEventArgs e)
@@ -77,13 +77,13 @@
IsCheckedChanged="Order_Checked"
Content="{locale:Locale OrderAscending}"
GroupName="Order"
IsChecked="{Binding SortingAscending, Mode=OneTime}"
IsChecked="{Binding SortingAscending, Mode=TwoWay}"
Tag="Ascending" />
<RadioButton
IsCheckedChanged="Order_Checked"
Content="{locale:Locale OrderDescending}"
GroupName="Order"
IsChecked="{Binding !SortingAscending, Mode=OneTime}"
IsChecked="{Binding !SortingAscending, Mode=TwoWay}"
Tag="Descending" />
</StackPanel>
</Flyout>
@@ -69,13 +69,13 @@ namespace Ryujinx.Ava.UI.Windows
public void Sort_Checked(object sender, RoutedEventArgs args)
{
if (sender is RadioButton { Tag: string sortField })
if (sender is RadioButton { IsChecked: true, Tag: string sortField })
ViewModel.SortingField = Enum.Parse<XCITrimmerViewModel.SortField>(sortField);
}
public void Order_Checked(object sender, RoutedEventArgs args)
{
if (sender is RadioButton { Tag: string sortOrder })
if (sender is RadioButton { IsChecked: true, Tag: string sortOrder })
ViewModel.SortingAscending = sortOrder is "Ascending";
}