C#C
C#3y ago
DaVinki

❔ ✅ Display all properties of different types without an attribute in a WPF list?

I have a Vehicle object that looks like this:

public class Vehicle
{
    [DoNotLogInCsv]
    private ILogger? Logger { get; }
    [DoNotLogInCsv]
    public VehicleProfile Profile { get; }
    public DescribedValue<float> Rpm { get; private set; }
    public DescribedValue<int> IntakeManifoldAbsolutePressure { get; private set; }
    public DescribedValue<float> EngineLoad { get; private set; }
    public DescribedValue<int> FuelPressure { get; private set; }
    public DescribedValue<float> ThrottlePosition { get; private set; }
    public DescribedValue<float> TimingAdvance { get; private set; }
    public DescribedValue<float> IntakeAirTemperature { get; private set; }
    public DescribedValue<float> ShortTermFuelTrimBank1 { get; private set; }
    public DescribedValue<float> LongTermFuelTrimBank1 { get; private set; }
    public DescribedValue<int> VehicleSpeed { get; private set; }
    public DescribedValue<float> MafAirFlowRate { get; private set; }
    public DescribedValue<int> RuntimeSinceEngineStart { get; private set; }
    public DescribedValue<float> CommandedAirFuelEquivalencyRatio { get; private set; }
    public DescribedValue<int> EngineOilTemperature { get; private set; }
    public DescribedValue<float> FuelInjectionTiming { get; private set; }
}


A described value is just a string Description and T Value pair object

I want to get all of these properties without the CSV logging attribute to be shown in a WPF list. Any ideas on how I can do this? Couldn't come up with anything after a few hours and can't find much online.
Was this page helpful?