diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index e5a815b28..2aaac4098 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -164,7 +164,7 @@ namespace Ryujinx.Ava.UI.Windows }); } - private void ApplicationLibrary_LdnGameDataReceived(object sender, LdnGameDataReceivedEventArgs e) + private void ApplicationLibrary_LdnGameDataReceived(LdnGameDataReceivedEventArgs e) { Dispatcher.UIThread.Post(() => { @@ -408,13 +408,10 @@ namespace Ryujinx.Ava.UI.Windows { StatusBarView.VolumeStatus.Click += VolumeStatus_CheckedChanged; + ApplicationGrid.DataContext = ApplicationList.DataContext = ViewModel; + ApplicationGrid.ApplicationOpened += Application_Opened; - - ApplicationGrid.DataContext = ViewModel; - ApplicationList.ApplicationOpened += Application_Opened; - - ApplicationList.DataContext = ViewModel; } private void SetWindowSizePosition() diff --git a/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs b/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs index e79602eaf..41bcff129 100644 --- a/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs +++ b/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs @@ -45,7 +45,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary public const string DefaultLanPlayWebHost = "ryuldnweb.vudjun.com"; public Language DesiredLanguage { get; set; } public event EventHandler ApplicationCountUpdated; - public event EventHandler LdnGameDataReceived; + public event Action LdnGameDataReceived; public readonly IObservableCache Applications; public readonly IObservableCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> TitleUpdates; @@ -779,7 +779,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary using HttpClient httpClient = new HttpClient(); string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games"); ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData); - LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs + LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs { LdnData = ldnGameDataArray }); @@ -787,7 +787,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary catch (Exception ex) { Logger.Warning?.Print(LogClass.Application, $"Failed to fetch the public games JSON from the API. Player and game count in the game list will be unavailable.\n{ex.Message}"); - LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs + LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs { LdnData = Array.Empty() }); @@ -795,7 +795,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary } else { - LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs + LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs { LdnData = Array.Empty() });