Wrong Return Type

c#, return-type

Solution

The return type of an event handler should be void:

private void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {

There's nothing at the other end to receive the return data.

Problem

I don't understand why I am getting an error of: 'System.Collections.Generic.List Notify.MainPage.webClient_OpenReadCompleted(object, System.Net.OpenReadCompletedEventArgs)' has the wrong return type Code: ``` webClient.OpenReadCompleted += webClient_OpenReadCompleted; ``` And: ``` private List<SightingType> webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { DataContractJsonSerializer ser = null; var sightingT = new List<SightingType>(); try { ser = new DataContractJsonSerializer(typeof(ObservableCollection<SightingType>)); ObservableCollection<SightingType> sightingTypes = ser.ReadObject(e.Result) as ObservableCollection<SightingType>; foreach (var sightingType in sightingTypes) { sightingT.Add(sightingType); } } catch (Exception ex) { MessageBox.Show(ex.Message); } return sightingT; } ``` Does anyone know where I am going wrong?

Original source