0

i try to show the number vote in my itemDetails page I receive my data from the page items all my data is readable yet (string Titre, string Description, int Vote) when i click on my button to acces on the items details page I receive the error object null, when is trying to read the INT. I tried to go into try.parse or a multitude of solution to the conversion but I can not find not good writing

Image

Thank you

FirebaseHelper firebaseHelper = new FirebaseHelper();

public ItemDetailsPage(string Titre, string Description, int Vote)
{       
    InitializeComponent();
    MyTitre.Text = Titre;           
    MyDescription.Text = Description;
    MyVote.Text = Vote.ToString();
}

   // ITEM PAGE
    protected async override void OnAppearing()
    {
        base.OnAppearing();
        var allIdeas = await firebaseHelper.GetAllIdeas();
        listIdeas.ItemsSource = allIdeas;
    }
    //    BOUTTON VERS PAGE DETAILS

    private async void OnItemSelected(Object sender, ItemTappedEventArgs e)
    {
        var details = e.Item as ItemsModel;
        await Navigation.PushAsync(new ItemDetailsPage(
            details.Titre, 
            details.Description , 
            details.Vote));
    }
---------------------------
 <Label HorizontalOptions="Center"
                  FlexLayout.Grow="1"
                   x:Name=" MyVote" d:Name="Name!"
                   BackgroundColor="Gray"/>
Stan Bomin
  • 19
  • 8

1 Answers1

1
<Label HorizontalOptions="Center"
                  FlexLayout.Grow="1"
                   x:Name=" MyVote" d:Name="Name!"
                   BackgroundColor="Gray"/>

Perhaps removing the space in front of the MyVote might fix the problem.

<Label HorizontalOptions="Center"
                  FlexLayout.Grow="1"
                   x:Name="MyVote" d:Name="Name!"
                   BackgroundColor="Gray"/>
  • OOOOh my god I am on this F.... error for 48 hours and I have not even slept because of this ... thank you thank you thank you you save my long-awaited night of sleep. – Stan Bomin May 13 '19 at 21:45