using System.Reflection; using Avalonia.Collections; using NitroxModel.Serialization; namespace Nitrox.Launcher.Models.Design; public record EditorField { public object Value { get; set; } public PropertyInfo PropertyInfo { get; init; } public AvaloniaList PossibleValues { get; set; } public string Description { get { string description = PropertyInfo.GetCustomAttribute()?.Description; if (string.IsNullOrWhiteSpace(description)) { description = null; } return description; } } public EditorField(PropertyInfo propertyInfo, object value, AvaloniaList possibleValues) { PropertyInfo = propertyInfo; Value = value; PossibleValues = possibleValues; } }