Add logic to the navigation to pass the selected item to the target screen's controller.
- [Instructor] If we step back to our main storyboard,…you'll remember that we set up this segue…between the table cell and our detail page.…This means that when you tap on or click…that particular item, it's going to navigate to that page.…What it doesn't do, or what it doesn't tell us…is what's the data that should be rendered on that page.…It just defines that particular segue.…So we need to go and set up our ViewController,…so that when we do that segue,…we can get that data ready to pass over to the controller.…
So we'll override.…We're going to override the PrepareForSegue.…So this is gonna fire before it actually does the segue…from one ViewController to the next.…And here we need to get back to our data source.…So we have our RoomsDataSource…and we're gonna get this.…TableView.Source has RoomsDataSource,…so we'll cast that.…And now we can get the particular room…from that data source.…
And we added that GetItem,…so we can go in and get the item now.…We're gonna have to use the TableView again…to get the IndexPathForSelectedRow,…
- Cross-platform code reuse
- Visual Studio install guidelines
- Remote Windows development
- Creating a .NET Standard library
- Testing on an Emulator
- Navigating a segue
- Provisioning and testing on a device
- Using constraints for a layout
- Creating list views and detail views
Skill Level Beginner
1. Welcome to Xamarin
2. Xamarin on Mac
3. Xamarin on Windows
4. Building a Shared Library
5. Building an Android Application
6. Building an iOS Application
7. Building a UWP Application
Next steps1m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.