* Add hooks to ApplicationLibrary for loading DLC/updates * Trigger DLC/update load on games refresh * Initial moving of DLC/updates to UI.Common * Use new models in ApplicationLibrary * Make dlc/updates records; use ApplicationLibrary for loading logic * Fix a bug with DLC window; rework some logic * Auto-load bundled DLC on startup * Autoload DLC * Add setting for autoloading dlc/updates * Remove dead code; bind to AppLibrary apps directly in mainwindow * Stub out bulk dlc menu item * Add localization; stub out bulk load updates * Set autoload dirs explicitly * Begin extracting updates to match DLC refactors * Add title update autoloading * Reduce size of settings sections * Better cache lookup for apps * Dont reload entire library on game version change * Remove ApplicationAdded event; always enumerate nsp when autoloading
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using Avalonia.Markup.Xaml;
|
|
using FluentAvalonia.UI.Controls;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.Ava.UI.Helpers
|
|
{
|
|
public class GlyphValueConverter : MarkupExtension
|
|
{
|
|
private readonly string _key;
|
|
|
|
private static readonly Dictionary<Glyph, string> _glyphs = new()
|
|
{
|
|
{ Glyph.List, char.ConvertFromUtf32((int)Symbol.List) },
|
|
{ Glyph.Grid, char.ConvertFromUtf32((int)Symbol.ViewAll) },
|
|
{ Glyph.Chip, char.ConvertFromUtf32(59748) },
|
|
{ Glyph.Important, char.ConvertFromUtf32((int)Symbol.Important) },
|
|
};
|
|
|
|
public GlyphValueConverter(string key)
|
|
{
|
|
_key = key;
|
|
}
|
|
|
|
public string this[string key]
|
|
{
|
|
get
|
|
{
|
|
if (_glyphs.TryGetValue(Enum.Parse<Glyph>(key), out var val))
|
|
{
|
|
return val;
|
|
}
|
|
|
|
return string.Empty;
|
|
}
|
|
}
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
{
|
|
return this[_key];
|
|
}
|
|
}
|
|
}
|