I have a special data set that requires storing data that is grouped and ordered. Then each line should be able to recalculate the amounts each time each element is changed.
This is the main form of the final result:

The structure of the object is as follows:
public class MyObject : INotifyPropertyChanged { public ObservableCollection<MySubObject> Objects { get; set; } public Decimal TotalOfAll { get; set; } } public class MySubObject : INotifyPropertyChanged { public Decimal Value { get; set; } public String RowType { get; set; } }
The view must bind to MyObject, and then group the Objects property using the Type property.
Now I have already done this without using reactive extensions, but it feels hacked ... I would like to do this by converting the Objects property of MyObject to an observable, which theoretically should allow me to update the summed when the value of the MySubObject property changes.
I already have a glance side of the built things, so no problem ... she launched the RX part.
Note:
I can alternatively expose my data as follows:
public class MyObject : INotifyPropertyChanged { public ObservableCollection<MyRowObject> Objects { get; set; } public Decimal TotalOfAll { get; set; } } public class MyRowObject : INotifyPropertyChanged { public ObservableCollection<MySubObject> Objects { get; set; } public String RowType { get; set; } public Decimal RowTotal { get; set; } } public class MySubObject : INotifyPropertyChanged { public Decimal Value { get; set; } }
This will take care of the grouping problem, but I still can't get it to work
source share