hola amigos tengo este error System.ObjectDisposedException: 'Cannot access a closed Stream.'
cuando le doy scroll a un listview que tengo, alguien sabe como puedo arreglar esto? o que me explique que esta pasando y como puedo preeverlo?
este es mi codigo
private async Task getWashers() {
try {
if (CrossConnectivity.Current.IsConnected) {
var uri = "http://miapifelizuwu.com/washers/";
var request = new HttpRequestMessage();
request.RequestUri = new Uri(uri);
var client = new HttpClient();
try {
HttpResponseMessage response = await client.SendAsync(request);
switch (response.StatusCode) {
case System.Net.HttpStatusCode.InternalServerError:
Console.WriteLine("----------------------------------------------_____:Here status 500");
break;
case System.Net.HttpStatusCode.OK:
Console.WriteLine("----------------------------------------------_____:Here status 200");
try {
HttpContent content = response.Content;
string xjson = await content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject < List < Washer >> (xjson);
if (result.Count() > 0) {
WasherList.ItemsSource = result;
WasherList.ItemTapped += PickerWasher_ItemTapped;
} else {
wlbl.Text = "Lo sentimos no hay washers cerca de momento, intenta mas tarde";
WasherList.IsVisible = false;
}
} catch (Exception ex) {
await DisplayAlert("", "" + ex.ToString(), "ok");
var x = ex.ToString();
return;
}
break;
case System.Net.HttpStatusCode.NotFound:
await DisplayAlert("error 404", "servidor no encontrado ", "ok");
break;
}
} catch (Exception ex) {
await DisplayAlert("Error", "Intente en otro momento _ error: " + ex.ToString() + " _ ", "ok");
}
}
} catch (Exception exc) {
await DisplayAlert("Error", "" + exc.ToString(), "ok");
}
}
<ListView x:Name="WasherList" ItemsSource="{Binding Washer}" Grid.Row="3" Grid.Column="0" HeightRequest="370" ItemTapped="PickerWasher_ItemTapped">
<!--Built in Cells-->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame x:Name="frame" CornerRadius="10" OutlineColor="#DCF8C6" BackgroundColor="white" Padding="0" HeightRequest="50" Margin="2,2,2,2">
<StackLayout Orientation="Vertical" Margin="10,10,10,10">
<StackLayout Orientation="Horizontal" HeightRequest="100">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="iko" Grid.Row="0" Grid.Column="0" HeightRequest="50" />
<Label Text="{Binding nombre} " FontSize="Small" Margin="0,15,0,0" TextColor="#128C7E" Grid.Row="0" Grid.Column="1" />
<lv:RatingConception ItemsNumber="5" DrawType="Star" Grid.Row="0" Grid.Column="2" BlockVote="True" IsEnabled="False" ImageWidth="20" ImageHeight="20" DesignType="Standard" ColorUI="YellowLight" InitialValue="{Binding calificacion}" HorizontalOptions="EndAndExpand"
x:Name="ratingStar" />
</Grid>
</StackLayout>
</StackLayout>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
getWashers lo llamo cuando la se inizializa
InitializeComponent();_=getWashers();