File
-> New Solution
and get started. Exciting times!Image
where our apps logo will sit.Label
and Entry
for our customers name.Label
and Entry
for our customers email address.Button
our customer can click to order their t-shirt!MyTShirt.xaml
2 4 6 8 10 12 14 16 | <ContentPage xmlns=“http://xamarin.com/schemas/2014/forms” xmlns:x=“http://schemas.microsoft.com/winfx/2009/xaml” <Image/> <Label Text=“Name: “/> </StackLayout> <Label Text=“Email: “/> </StackLayout> </ContentPage> |
ContentPage
instead of a view group such as a grid or stack layout. If we ran our app, we’d only see our image control! This is a common and easy-to-make mistake when creating a new screen that causes a hard-to-find runtime bug.ContentPage
‘s children with a stack layout to quickly resolve the bug:Source
property of our image.Alt
+Return
on the issue to import the missing image!MyTShirtViewModel
, and then implement all the data-bindings into the view model as public properties. It will even generate a command stub for the buttons OrderTShirt
command!Page
and ViewModel
naming convention when generating new view models. It will also consider theMyTShirtPage
and MyTShirtViewModel
associated through this naming convention.