Me ajude por favor,estou desenvolvendo um app e em certo momento o usuário pode ligar para uma pessoa.
tenho o trecho de código abaixo. Porém ele da esse erro:
"An unhandled exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in Microsoft.Phone.Interop.ni.dll
Additional information: Type 'Pelada_do_dia.Model.Pelada' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure
that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required. "
private void imgLigacao_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
PhoneCallTask phoneCallTask = new PhoneCallTask();
Boleiro b = (Boleiro)listaBoleiros.SelectedItem;
try
{
//convertendo o telefone inteiro para uma string, o textbox tem o escopo de "numeric"
phoneCallTask.PhoneNumber = Convert.ToString(b.Telefone);
phoneCallTask.DisplayName = b.Nome;
phoneCallTask.Show();
}
catch
{
MessageBox.Show("Não foi possível fazer essa ligação","Aviso", MessageBoxButton.OK);
}
}