misc: Small code improvements.

This commit is contained in:
Evan Husted 2024-10-14 15:03:09 -05:00
parent 5f6d9eef6b
commit b2a35ecf6c
6 changed files with 71 additions and 112 deletions

View file

@ -1,6 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Interactivity;
using Avalonia.Styling;
using FluentAvalonia.UI.Controls;
@ -64,21 +62,14 @@ namespace Ryujinx.Ava.UI.Windows
private void OpenLocation(object sender, RoutedEventArgs e)
{
if (sender is Button button)
{
if (button.DataContext is TitleUpdateModel model)
{
OpenHelper.LocateFile(model.Path);
}
}
if (sender is Button { DataContext: TitleUpdateModel model })
OpenHelper.LocateFile(model.Path);
}
private void RemoveUpdate(object sender, RoutedEventArgs e)
{
if (sender is Button button)
{
ViewModel.RemoveUpdate((TitleUpdateModel)button.DataContext);
}
if (sender is Button { DataContext: TitleUpdateModel model })
ViewModel.RemoveUpdate(model);
}
private void RemoveAll(object sender, RoutedEventArgs e)