Forum Xamarin.Forms

Navigate to a new page from my API ID

I understand this should be easier using listview but my design wasn't getting along too well with it so I needed to use something else, this is what I have:

<StackLayout BindableLayout.ItemsSource="{Binding Posts}">

                        <Grid Margin="5" RowSpacing="0" x:Name="postsTable">
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <RowDefinition Height="200"/>

                            <ImageButton Grid.Column="0" Grid.ColumnSpan="2" Source="{Binding postImage}"  VerticalOptions="Fill" HorizontalOptions="Fill" Aspect="AspectFill" Command="{Binding OpenPageCommand}"/>
                            <StackLayout Grid.Column="0" Grid.ColumnSpan="2" VerticalOptions="End" HorizontalOptions="Start" Margin="10">
                                <Label Text="{Binding title}" FontFamily="{StaticResource BoldFont}" StyleClass="titlesqr"/>
                                <Label Text="{Binding subtitle}" FontFamily="{StaticResource NormalFont}" StyleClass="textsqr"/>



How can I open a new contentpage making an API query with the post ID of the pressed item? my api call should be something like "" + id;

I don't quite understand how do I get and pass the id from the itemtemplate


Sign In or Register to comment.