All,
Need some help here.. I have an array of string and need to bind that to ObservableCollection
Thanks in advance.
The ObservableCollection<T>
class can receive an IEnumerable<T>
on the constructor. You can use it like this:
string[] items = ...
ObservableCollection<string> observableItems = new ObservableCollection<string>(items);
Edit: If your array changes in the future, your ObsevableCollection
won't. If you want that, please, specify it in your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With