- add: language
This commit is contained in:
@@ -19,13 +19,16 @@ public class FilterBox : UserControl
|
||||
|
||||
public Action<FilterBoxChangedEventArgs>? OnFilterChanged {get; set;}
|
||||
|
||||
public string? FilterBoxName {
|
||||
set => filterName.Text = value;
|
||||
get => filterName.Text;
|
||||
public string FilterBoxName {
|
||||
set => filterName.LocalId = value;
|
||||
get => filterName.LocalId;
|
||||
}
|
||||
|
||||
private StackPanel filterPanel;
|
||||
private TextBox filterName = new TextBox();
|
||||
private LocalizedLabel filterName = new LocalizedLabel()
|
||||
{
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
|
||||
public FilterBox()
|
||||
{
|
||||
@@ -34,6 +37,8 @@ public class FilterBox : UserControl
|
||||
Orientation = Orientation.Horizontal,
|
||||
Spacing = 5,
|
||||
};
|
||||
|
||||
filterPanel.Children.Add(filterName);
|
||||
|
||||
Content = filterPanel;
|
||||
}
|
||||
|
||||
20
Nebula.Launcher/Controls/LocalizedLabel.cs
Normal file
20
Nebula.Launcher/Controls/LocalizedLabel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Nebula.Launcher.Services;
|
||||
|
||||
namespace Nebula.Launcher.Controls;
|
||||
|
||||
public class LocalizedLabel : Label
|
||||
{
|
||||
public static readonly StyledProperty<string> LocalIdProperty = AvaloniaProperty.Register<LocalizedLabel, string>(nameof(LocalId));
|
||||
|
||||
public string LocalId
|
||||
{
|
||||
get => GetValue(LocalIdProperty);
|
||||
set
|
||||
{
|
||||
SetValue(LocalIdProperty, value);
|
||||
Content = LocalisationService.GetString(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user