Ormad
Ormad

Reputation: 1

.Net Dynamic Data List

I recently started exploring Dynamic Data to try to convert lists of my .net desktop app into dynamic lists because I need for example to have a list of barcodes with properties that change based on other classes properties

I have this code, it works fine but only the first time (when list gets loaded first time). Then if I change any property of the list from the UI (for example: dividend or divisor) the code in the foreach never executes. The list is bound through XAML Binding.

I wanted to ask you what I am missing. The list was an observablecollection and I tried with a custom one implementing per-item PropertyChanged but nothing changes even if it tracks any changes for added/updated/removed items

Thank you in advance

            this.WhenPropertyChanged(x => x.Item.Barcodes)
                .Select(x => x.Value)
                .Subscribe(value =>
                {
                    foreach (var bar in value)
                    {
                        bar.DisplayPrice = Item.prezzo * bar.dividend / bar.divisor * (1 + (decimal)Item.iva / 100);
                    }
                });

Upvotes: 0

Views: 54

Answers (0)

Related Questions