misc: Code cleanups & remove references to Patreon & Twitter.

This commit is contained in:
Evan Husted 2024-10-11 17:56:59 -05:00
parent 26e9aa11d5
commit 4c237c4793
27 changed files with 91 additions and 307 deletions

View file

@ -6,33 +6,23 @@ using System;
namespace Ryujinx.Ava.Common.Locale
{
internal class LocaleExtension : MarkupExtension
internal class LocaleExtension(LocaleKeys key) : MarkupExtension
{
public LocaleExtension(LocaleKeys key)
{
Key = key;
}
public LocaleKeys Key { get; }
public LocaleKeys Key { get; } = key;
public override object ProvideValue(IServiceProvider serviceProvider)
{
LocaleKeys keyToUse = Key;
var builder = new CompiledBindingPathBuilder();
builder
.Property(new ClrPropertyInfo("Item",
obj => (LocaleManager.Instance[keyToUse]),
null,
typeof(string)), (weakRef, iPropInfo) =>
{
return PropertyInfoAccessorFactory.CreateInpcPropertyAccessor(weakRef, iPropInfo);
});
builder.Property(
new ClrPropertyInfo("Item",
_ => LocaleManager.Instance[Key],
null,
typeof(string)
),
PropertyInfoAccessorFactory.CreateInpcPropertyAccessor);
var path = builder.Build();
var binding = new CompiledBindingExtension(path)
var binding = new CompiledBindingExtension(builder.Build())
{
Source = LocaleManager.Instance
};