using Avalonia.Collections; using System; using System.ComponentModel; using System.Reflection; namespace SukiUI.Controls { public sealed class EnumViewModel : PropertyViewModelBase { public IAvaloniaReadOnlyList Values { get; } public EnumViewModel(INotifyPropertyChanged viewmodel, string displayName, PropertyInfo propertyInfo) : base(viewmodel, displayName, propertyInfo) { var temp = new AvaloniaList(); foreach (var item in Enum.GetValues(propertyInfo.PropertyType)) { temp.Add(item); } Values = temp; } } }