mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-16 12:26:29 +02:00
misc: chore: Use static instances of converters instead of using control resources
This commit is contained in:
parent
a469f3d710
commit
191e158289
20 changed files with 82 additions and 134 deletions
|
@ -9,7 +9,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
{
|
||||
internal class BitmapArrayValueConverter : IValueConverter
|
||||
{
|
||||
public static BitmapArrayValueConverter Instance = new();
|
||||
public static readonly BitmapArrayValueConverter Instance = new();
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
{
|
||||
internal class DownloadableContentLabelConverter : IMultiValueConverter
|
||||
{
|
||||
public static DownloadableContentLabelConverter Instance = new();
|
||||
public static readonly DownloadableContentLabelConverter Instance = new();
|
||||
|
||||
public object Convert(IList<object> values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
{
|
||||
internal class KeyValueConverter : IValueConverter
|
||||
{
|
||||
public static KeyValueConverter Instance = new();
|
||||
public static readonly KeyValueConverter Instance = new();
|
||||
|
||||
private static readonly Dictionary<Key, LocaleKeys> _keysMap = new()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
@ -19,15 +18,10 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
{
|
||||
return $"Hosted Games: {applicationData.GameCount}\nOnline Players: {applicationData.PlayerCount}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
{
|
||||
internal class TitleUpdateLabelConverter : IMultiValueConverter
|
||||
{
|
||||
public static TitleUpdateLabelConverter Instance = new();
|
||||
public static readonly TitleUpdateLabelConverter Instance = new();
|
||||
|
||||
public object Convert(IList<object> values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
internal class XCITrimmerFileSpaceSavingsConverter : IValueConverter
|
||||
{
|
||||
private const long _bytesPerMB = 1024 * 1024;
|
||||
public static XCITrimmerFileSpaceSavingsConverter Instance = new();
|
||||
public static readonly XCITrimmerFileSpaceSavingsConverter Instance = new();
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue