mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 02:26:23 +02:00
misc: Abstract repeated logic in markup extensions & move Updater into the base of the Avalonia project.
This commit is contained in:
parent
4c83794254
commit
1c07bf3dd0
10 changed files with 52 additions and 74 deletions
39
src/Ryujinx/Common/Markup/MarkupExtensions.cs
Normal file
39
src/Ryujinx/Common/Markup/MarkupExtensions.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using Avalonia.Data.Core;
|
||||
using Projektanker.Icons.Avalonia;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
|
||||
namespace Ryujinx.Ava.Common.Markup
|
||||
{
|
||||
internal class IconExtension(string iconString) : BasicMarkupExtension
|
||||
{
|
||||
protected override ClrPropertyInfo PropertyInfo
|
||||
=> new(
|
||||
"Item",
|
||||
_ => new Icon { Value = iconString },
|
||||
null,
|
||||
typeof(Icon)
|
||||
);
|
||||
}
|
||||
|
||||
internal class SpinningIconExtension(string iconString) : BasicMarkupExtension
|
||||
{
|
||||
protected override ClrPropertyInfo PropertyInfo
|
||||
=> new(
|
||||
"Item",
|
||||
_ => new Icon { Value = iconString, Animation = IconAnimation.Spin },
|
||||
null,
|
||||
typeof(Icon)
|
||||
);
|
||||
}
|
||||
|
||||
internal class LocaleExtension(LocaleKeys key) : BasicMarkupExtension
|
||||
{
|
||||
protected override ClrPropertyInfo PropertyInfo
|
||||
=> new(
|
||||
"Item",
|
||||
_ => LocaleManager.Instance[key],
|
||||
null,
|
||||
typeof(string)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue