Skip to content

Commit

Permalink
feat(sample): add checkbox column
Browse files Browse the repository at this point in the history
  • Loading branch information
giard-alexandre committed Sep 26, 2024
1 parent ac1cd1b commit 53b28e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/SampleApp/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public MainWindowViewModel() {
.RuleFor(person => person.Height, faker => faker.Random.Double())
.RuleFor(person => person.Gender, faker => faker.Person.Gender)
.RuleFor(person => person.Money, faker => faker.Finance.Amount(-1000M, 1000M, 5))
.RuleFor(person => person.IsChecked, faker => faker.Random.Bool())
.Generate(300)).ToObservableChangeSet(person => person.Id);

DataSource = new DynamicFlatTreeDataGridSource<Person, int>(data) {
Expand All @@ -35,6 +36,7 @@ public MainWindowViewModel() {
new DynamicTextColumn<Person, double>("Height-Raw", "Raw Height", person => person.Height),
new DynamicTextColumn<Person, Name.Gender>("Gender", "Gender", person => person.Gender), // To Template
new DynamicTextColumn<Person, decimal>("Money", "Money", person => person.Money),
new DynamicCheckBoxColumn<Person>("Checked", "Checked", person => person.IsChecked),
},
};
}
Expand All @@ -46,5 +48,6 @@ public record Person {
public DateTime DateOfBirth { get; set; }
public double Height { get; set; }
public Name.Gender Gender { get; set; }
public Decimal Money { get; set; }
public decimal Money { get; set; }
public bool IsChecked { get; set; }
}

0 comments on commit 53b28e6

Please sign in to comment.