initial commit
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace QuickStartExample.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Simple example class demonstrating PropertyGrid usage
|
||||
/// </summary>
|
||||
public class Vehicle
|
||||
{
|
||||
[Display(Name = "Make", Description = "Vehicle manufacturer", Order = 1)]
|
||||
[Category("Basic Info")]
|
||||
public string Make { get; set; } = "Tesla";
|
||||
|
||||
[Display(Name = "Model", Description = "Vehicle model", Order = 2)]
|
||||
[Category("Basic Info")]
|
||||
public string Model { get; set; } = "Model 3";
|
||||
|
||||
[Display(Name = "Year", Description = "Manufacturing year", Order = 3)]
|
||||
[Category("Basic Info")]
|
||||
public int Year { get; set; } = 2024;
|
||||
|
||||
[Display(Name = "Color", Description = "Vehicle color", Order = 4)]
|
||||
[Category("Appearance")]
|
||||
public string Color { get; set; } = "Red";
|
||||
|
||||
[Display(Name = "Mileage", Description = "Current mileage in miles", Order = 5)]
|
||||
[Category("Status")]
|
||||
public double Mileage { get; set; } = 5000.0;
|
||||
|
||||
[Display(Name = "Is Electric", Description = "Electric vehicle", Order = 6)]
|
||||
[Category("Technical")]
|
||||
public bool IsElectric { get; set; } = true;
|
||||
|
||||
[Display(Name = "Fuel Type", Description = "Type of fuel", Order = 7)]
|
||||
[Category("Technical")]
|
||||
public FuelType FuelType { get; set; } = FuelType.Electric;
|
||||
|
||||
[Display(Name = "Price", Description = "Purchase price", Order = 8)]
|
||||
[Category("Financial")]
|
||||
public decimal Price { get; set; } = 45000.00m;
|
||||
|
||||
[Display(Name = "Purchase Date", Description = "Date of purchase", Order = 9)]
|
||||
[Category("Financial")]
|
||||
public DateTime PurchaseDate { get; set; } = DateTime.Now;
|
||||
|
||||
[Display(Name = "VIN", Description = "Vehicle Identification Number", Order = 10)]
|
||||
[Category("Registration")]
|
||||
[ReadOnly(true)]
|
||||
public string VIN { get; set; } = "1HGBH41JXMN109186";
|
||||
}
|
||||
|
||||
public enum FuelType
|
||||
{
|
||||
Gasoline,
|
||||
Diesel,
|
||||
Electric,
|
||||
Hybrid,
|
||||
Hydrogen
|
||||
}
|
||||
Reference in New Issue
Block a user