feat: add avalonia basic ComboBox style.
This commit is contained in:
1 parent
d4406c2888
commit
94ee336714
12 files changed
+593
-8
No files matched your search
@@ -1,5 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using HandyControlDemo.Properties.Langs;
|
||||
using HandyControlDemo.Tools.Converter;
|
||||
|
||||
namespace HandyControlDemo.ViewModel;
|
||||
|
||||
@@ -20,4 +24,23 @@ public partial class InputElementDemoViewModel : ObservableValidator
|
||||
[ObservableProperty] private double? _doubleValue1;
|
||||
|
||||
[ObservableProperty] private double? _doubleValue2;
|
||||
|
||||
[ObservableProperty] private IList<string>? _dataList;
|
||||
|
||||
public InputElementDemoViewModel()
|
||||
{
|
||||
DataList = GetComboBoxDemoDataList();
|
||||
}
|
||||
|
||||
private static List<string> GetComboBoxDemoDataList()
|
||||
{
|
||||
var converter = new StringRepeatConverter();
|
||||
var list = new List<string>();
|
||||
for (int i = 1; i <= 9; i++)
|
||||
{
|
||||
list.Add($"{converter.Convert(Lang.Text, null!, i, CultureInfo.CurrentCulture)}{i}");
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user