Hello i've written some classes
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public int Points { get; set; }
public string Status { get; set; }
}
public class Item
{
public int Id { get; set; }
public string Name { get; set; }
public int DefaultAmount { get; set; }
}
public class ItemsOrders
{
public Person Person { get; set; }
public List<Item> OrderedItems { get; set; }
}
public class ViewModel
{
//...
private ObservableCollection<ItemsOrders> _orders;
public ObservableCollection<ItemsOrders> Orders
{
get { return _orders; }
set { _orders = value; }
}
//...
}
How to build a view that shows the ViewModel and looks like:
The check box rows are active when checkbox is check.
Each person has assigned some items. These items are stored in OrderedItems property in ItemsOrdersClass. Each person have assigned 0 or more Items
Which controls use to build the view and how to bind data?
Thank you for help.
The marked parts have to act like Numeric UpDown (in WinForms World :-)). The default value for this controls is read from the database (
DefaultAmount property in Item class) and user adjust this value as he needs. In my example a user chose 1 Laptop and 1 Keyboard. User can only change values in rows that he selected by checkbox.