mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-21 18:21:13 +02:00
UI: Fix sort timing
- Now sorts instantly when an option is selected Co-authored-by: _Neo_ <ursamajorjanus2819@gmail.com>
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user