Answered my own post -- how to read ObservableCollection to an array --
tim
200
Reputation points
I may be doing this the wrong way, I want to read all the Line in my listview to be able to add them to an array.
xaml
<ListView ItemsSource="{Binding MyItems}" IsGroupingEnabled="True" GroupShortNameBinding="{Binding Key}" GroupDisplayBinding="{Binding Key}" HasUnevenRows="True" >
<ListView.ItemTemplate >
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Amountc}"
HorizontalOptions="CenterAndExpand" FontAttributes="Bold"
VerticalOptions="CenterAndExpand"/>
```**CS code -I'm getting the error on the Amountc , not sure what I need to use.**
Linecount = MyItems.Count;
```r
for (int li = 0; li < Linecount; li++)
{
CollectedData[li] = MyItems.ElementAt(li).**Amountc**;
}
```TIA.
Tim
Sign in to answer