Fix LocaleExtension SetRawSource usages + language perf improvement (#7121)
* Avoid Avalonia CompiledBindingPathBuilder.SetRawSource * Improve UI language change performance
This commit is contained in:
parent
42f22fe5d7
commit
e85ee673b1
@ -21,7 +21,7 @@ namespace Ryujinx.Ava.Common.Locale
|
||||
|
||||
var builder = new CompiledBindingPathBuilder();
|
||||
|
||||
builder.SetRawSource(LocaleManager.Instance)
|
||||
builder
|
||||
.Property(new ClrPropertyInfo("Item",
|
||||
obj => (LocaleManager.Instance[keyToUse]),
|
||||
null,
|
||||
@ -32,7 +32,10 @@ namespace Ryujinx.Ava.Common.Locale
|
||||
|
||||
var path = builder.Build();
|
||||
|
||||
var binding = new CompiledBindingExtension(path);
|
||||
var binding = new CompiledBindingExtension(path)
|
||||
{
|
||||
Source = LocaleManager.Instance
|
||||
};
|
||||
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
|
@ -139,9 +139,11 @@ namespace Ryujinx.Ava.Common.Locale
|
||||
|
||||
foreach (var item in locale)
|
||||
{
|
||||
this[item.Key] = item.Value;
|
||||
_localeStrings[item.Key] = item.Value;
|
||||
}
|
||||
|
||||
OnPropertyChanged("Item");
|
||||
|
||||
LocaleChanged?.Invoke();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user