Xamarin.Forms Shell GoToAsync pass a object

RubenGlamRubenGlam Member ✭✭

Hi, i'm using the shell in my app and i tried to navigate a external page using routes but i couldn't pass un object from my model. It throwed a exception saying that the object isn't a string. How i can do it?

Thanks you!

Best Answer

Answers

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @RubenGlam said:
    Hi, i'm using the shell in my app and i tried to navigate a external page using routes but i couldn't pass un object from my model. It throwed a exception saying that the object isn't a string. How i can do it?

    Thanks you!

    Make sure it is a string type ,Check Bold Text below

    (App.Current.MainPage as Xamarin.Forms.Shell).GoToAsync($"app://tailwindtraders/productcategory?id={typeId}", true);

  • RubenGlamRubenGlam Member ✭✭

    @Charwaka I want that typeId isn't a string. I need pass other object (for example a label). That is possible?

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @RubenGlam said:
    @Charwaka I want that typeId isn't a string. I need pass other object (for example a label). That is possible?

    use .ToString to convert Label

  • RubenGlamRubenGlam Member ✭✭
    edited April 4

    @Charwaka
    I didn't get it yet. I have a listview which have a list of items (objects from my model, it have a id, name, image...). When I will click a item from listview i want open a new page using routes and pass the object clicked. Then, in the new page i want get the object and show the name and image for example. I want know if it is possible. Sorry my english is so bad :(

    Ty

Sign In or Register to comment.