Wtf1sh
Wtf1sh

Reputation: 137

Binding values from List<int> to Controls?

Suppose I have List myNumbers. I have a set of Sliders, and I want to bind i.th Sliders value to myNumbers[i]. Int-s are not properties, so i cant bind to them.

Should I store my data in another way?

Is there another way to make the binding magic work?

Upvotes: 0

Views: 138

Answers (1)

Nick
Nick

Reputation: 5042

Can't you bind to the list as indexer like that "{Binding Path=[i]}" where i is the index of the respective slider?

Upvotes: 1

Related Questions