mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-07 02:38:29 +02:00
Move solution and projects to src
This commit is contained in:
30
src/Ryujinx.Ava/Common/Locale/LocaleExtension.cs
Normal file
30
src/Ryujinx.Ava/Common/Locale/LocaleExtension.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Markup.Xaml.MarkupExtensions;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Ava.Common.Locale
|
||||
{
|
||||
internal class LocaleExtension : MarkupExtension
|
||||
{
|
||||
public LocaleExtension(LocaleKeys key)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
|
||||
public LocaleKeys Key { get; }
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
LocaleKeys keyToUse = Key;
|
||||
|
||||
ReflectionBindingExtension binding = new($"[{keyToUse}]")
|
||||
{
|
||||
Mode = BindingMode.OneWay,
|
||||
Source = LocaleManager.Instance
|
||||
};
|
||||
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user