2 1-Cabana-Xam1 4
2 1-Cabana-Xam1 4
talkwithangel.com
92-117 minutes
Right now the app is only available for Android, we will rebuild and
redefine the design with Xamarin Forms to have both platforms
(iOS and Android).
3. Moving the data to the cloud: Let’s make our backend with Azure
Functions and CosmosDB and consume it from the app.
1 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
For the app structure we are going to follow my recipe for a Clean
Architecture using this template which already has Prism as MVVM
framework, if you want to know more about making and consuming
your own templates see this post.
Let’s begin installing the template using the .NET Core CLI, to do
this we are going to download or clone this repository, open a
terminal in the root folder and run the following command:
Go to the created project and open the solution file to start coding
our Xamarin app.
2 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Xamarin.Forms ⇒ 4.7.0.1080
Xamarin.Essentials ⇒ 1.5.3.2
3 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
using System;
using Prism;
using Prism.Ioc;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using CabanasRD.UI.Main.Views;
using CabanasRD.UI.Main.ViewModels;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace CabanasRD
4 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
InitializeComponent();
await
NavigationService.NavigateAsync("NavigationPage/MainTabbedPage");
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<MainTabbedPage,
MainTabbedPageViewModel>();
<TabbedPage
x:Class="CabanasRD.UI.Main.Views.MainTabbedPage"
xmlns="http://xamarin.com/schemas/2014/forms"
5 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-
namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
NavigationPage.HasNavigationBar="False"
Style="{DynamicResource TabStyle}">
<TabbedPage.Children>
</ContentPage>
</ContentPage>
</TabbedPage.Children>
</TabbedPage>
<Application.Resources>
....
<Style TargetType="NavigationPage">
</Style>
</Style>
6 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
....
</Application.Resources>
Now we can use the unicode provided by Font Awesome for the
desired icons:
7 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<TabbedPage
x:Class="CabanasRD.UI.Main.Views.MainTabbedPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-
namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
NavigationPage.HasNavigationBar="False"
Style="{DynamicResource TabStyle}">
<TabbedPage.Children>
<ContentPage.IconImageSource>
<FontImageSource FontFamily="Font-Awesome-Solid"
Glyph="" />
</ContentPage.IconImageSource>
</ContentPage>
<ContentPage.IconImageSource>
<FontImageSource FontFamily="Font-Awesome-Solid"
Glyph="" />
</ContentPage.IconImageSource>
</ContentPage>
</TabbedPage.Children>
</TabbedPage>
8 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
The next step will be set up the map, if you go back to the design
you notice that the map is black and white (has a style) and we
have orange custom pins, the Xamarin.Forms.Map control doesn’t
have this feature and we don’t want to waste time doing a custom
renderer just for this, so, we are going to use
Xamarin.Forms.GoogleMaps package (3.2.1) which extends the
9 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelsMapPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;
assembly=Xamarin.Forms.GoogleMaps"
NavigationPage.HasNavigationBar="False">
<ContentPage.Content>
<Grid>
<maps:Map
x:Name="MotelsMap"
HorizontalOptions="FillAndExpand"
ItemsSource="{Binding Locations}"
10 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
MapType="Street"
VerticalOptions="FillAndExpand">
<maps:Map.ItemTemplate>
<DataTemplate>
<maps:Pin
Icon="{Binding Icon}"
Label="{Binding Motel.Name}"
</DataTemplate>
</maps:Map.ItemTemplate>
</maps:Map>
</Grid>
</ContentPage.Content>
</ContentPage>
Now, add this as the content page for the first tab, so our
MainTabbedPage.xaml will look like this:
<TabbedPage
x:Class="CabanasRD.UI.Main.Views.MainTabbedPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-
namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
assembly=Xamarin.Forms.Core"
11 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
xmlns:mapViews="clr-namespace:CabanasRD.UI.Map.Views"
android:TabbedPage.ToolbarPlacement="Bottom"
NavigationPage.HasNavigationBar="False"
Style="{DynamicResource TabStyle}">
<TabbedPage.Children>
<mapViews:MotelsMapPage.IconImageSource>
<FontImageSource FontFamily="Font-Awesome-Solid"
Glyph="" />
</mapViews:MotelsMapPage.IconImageSource>
</mapViews:MotelsMapPage>
<ContentPage.IconImageSource>
<FontImageSource FontFamily="Font-Awesome-Solid"
Glyph="" />
</ContentPage.IconImageSource>
</ContentPage>
</TabbedPage.Children>
</TabbedPage>
Register the new view in the container and …. Yessir! we have the
map view ready:
12 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Next step is the style of the map, go to this site, select and
download the “Silver Theme” JSON, add it to App/CabanasRD root
folder as “GoogleMapStyles.json”, and then add the following to the
code behind of our MotelsMapPage.xaml (thanks Rendy for this
post):
using System;
using System.Collections.Generic;
using System.Reflection;
13 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
using CabanasRD.UI.Map.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.GoogleMaps;
namespace CabanasRD.UI.Map.Views
public MotelsMapPage()
InitializeComponent();
AddMapStyle();
void AddMapStyle()
var stream =
assembly.GetManifestResourceStream($"CabanasRD.GoogleMapStyles.json
string styleFile;
styleFile = reader.ReadToEnd();
MotelsMap.MapStyle = MapStyle.FromJson(styleFile);
14 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
15 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Before adding the Pins collection we need the custom pin image,
the map control we are using has a Bindable Property for this.
Add a “marker.png” in the Assets folder for the Android project, and
also add the marker image to the Resources folder for the iOS
project.
Time to make our app business logic, we are going to create the
following structure in the Core/CabanasRD.Domain layer:
16 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Task<IReadOnlyList<Motel>> GetAll();
17 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
_motelsSource = motelsSource;
_motelsRepository = motelsRepository;
return _motelsRepository.GetMotelsAsync();
18 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Now we have to implement the data source, in this first post will be
in memory list, let’s move to App/CabanasRD/Framework
/DataSources and create a “InMemoryMotelsSource.cs” with the
following content:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CabanasRD.Data.Motels;
using CabanasRD.Domain.Motels;
namespace CabanasRD.Framework.DataSources
await Task.Delay(1000);
new Motel{
Id = 2,
Latitude = 18.4895593,
Longitude = -69.8247819,
19 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
new MotelImage {
Url = "https://c2.peakpx.com/wallpaper/604/823/790/castle-
fortress-defense-architecture-wallpaper-preview.jpg"
},
new MotelImage {
Url = "https://media.npr.org/assets/img/2015/08/15
/robin1-8aea039fd0710bd0c8549c19abab4085e0e3024c-s800-
c85.jpg"
},
new MotelImage {
Url = "https://c2.peakpx.com/wallpaper/604/823/790/castle-
fortress-defense-architecture-wallpaper-preview.jpg"
},
new MotelImage {
Url = "https://media.npr.org/assets/img/2015/08/15
/robin1-8aea039fd0710bd0c8549c19abab4085e0e3024c-s800-
c85.jpg"
},
new MotelImage {
Url = "https://c2.peakpx.com/wallpaper/604/823/790/castle-
fortress-defense-architecture-wallpaper-preview.jpg"
},
new MotelImage {
Url = "https://media.npr.org/assets/img/2015/08/15
/robin1-8aea039fd0710bd0c8549c19abab4085e0e3024c-s800-
c85.jpg"
},
20 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
},
new MotelService {
Name = "Normal",
Price = 725.00
},
new MotelService {
Name = "Ejecutiva",
Price = 925.00
},
new MotelService {
Price = 1050.00
},
new MotelService {
Name = "Presidencial",
Price = 1350.00
};
21 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Register all the necessary dependencies for the use case in the
App.xaml.cs:
using System;
using Prism;
using Prism.Ioc;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using CabanasRD.Framework.DataSources;
using CabanasRD.UI.Map.Views;
using CabanasRD.UI.Map.ViewModels;
using CabanasRD.Data.Motels;
using CabanasRD.UseCases.Motels;
using CabanasRD.UI.Main.Views;
using CabanasRD.UI.Main.ViewModels;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace CabanasRD
InitializeComponent();
22 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
await
NavigationService.NavigateAsync("NavigationPage/MainTabbedPage");
//Views
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<MainTabbedPage,
MainTabbedPageViewModel>();
containerRegistry.RegisterForNavigation<MotelsMapPage,
MotelsMapPageViewModel>();
containerRegistry.Register<MotelsRepository>();
containerRegistry.Register<IMotelsSource, InMemoryMotelsSource>();
//Use cases
containerRegistry.Register<GetAllMotels>();
For the map pins position and image we are going to use a DTO (or
model in the UI), place a file called “MotelLocation.cs” in
App/CabanasRD/UI/Map/Models:
using System;
using CabanasRD.Domain.Motels;
using Xamarin.Forms;
using Xamarin.Forms.GoogleMaps;
23 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
namespace CabanasRD.UI.Map.Models
using System;
using System.Collections.ObjectModel;
using System.Linq;
using CabanasRD.UI.Map.Models;
using CabanasRD.UI.ViewModels;
using CabanasRD.UseCases.Motels;
using Prism.Commands;
using Prism.Navigation;
using Xamarin.Forms.GoogleMaps;
namespace CabanasRD.UI.Map.ViewModels
24 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
public MotelsMapPageViewModel(INavigationService
navigationService, GetAllMotels getAllMotels)
: base(navigationService)
_getAllMotels = getAllMotels;
Title = "Cabañas";
LoadMotelsLocations();
Locations.Add(new MotelLocation {
Motel = item,
Icon = BitmapDescriptorFactory.FromBundle(markerIcon)
});
25 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
26 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
//In MotelsMapPage.xaml
<maps:Map
...
InfoWindowClicked="InfoWindowClicked"
....
</maps:Map>
//In MotelsMapPage.xaml.cs
((MotelsMapPageViewModel)this.BindingContext).InfoWindowSelected(e.Pin);
navParams.Add("MotelDetails", motelDetails.Motel);
NavigationService.NavigateAsync("MotelDetailsPage", navParams);
27 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
As you can see, we have now the logic to navigate to the motel
details page, let’s create this view (this is the funny part), we need
to create a MotelDetailsPage.xaml (under Views),
MotelDetailsPageViewModel.cs (under ViewModels) in
App/CabanasRD/UI/Map, and then register the new view in the
App.xaml.cs.
Before going to the XAML’s part, let’s put the following code in our
MotelDetailsPageViewModel:
using System;
using System.Collections.ObjectModel;
using CabanasRD.Domain.Motels;
using CabanasRD.UI.ViewModels;
using Prism.Navigation;
namespace CabanasRD.UI.Map.ViewModels
28 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
public MotelDetailsPageViewModel(INavigationService
navigationService)
: base(navigationService)
base.OnNavigatedTo(parameters);
Motel = parameters.GetValue<Motel>("MotelDetails");
Name = Motel.Name;
Images.Add(item);
29 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Phones.Add(item);
Services.Add(item);
Cool, now that we have the blank view connected with its view
model, let’s start defining the main container as a Grid with 5 rows
with the following definitions:
30 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
</Grid>
</ScrollView>
</ContentPage.Content>
31 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</ContentPage>
For the gradients and the rounded layouts, we are going to use the
awesome PancakeView version 1.4.2, follow the setup before
continuing.
For some elements style, like the button in the header, we are
going to use Xamarin.Forms.Visual.Material, follow the setup before
continuing.
Cool, now let’s use a PancakeView as container for the first row
(header) inside the Grid we defined before:
xmlns:yummy="clr-
namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
32 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
UINavigationBar.Appearance.ShadowImage = new
UIImage();
let’s see:
33 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
For making the bottom shape for this row, we are going to use a
SVG with the desired form (extracted from the Adobe XD design)
and place it vertically at the end.
<ContentPage
34 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
35 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
HorizontalOptions="FillAndExpand" />
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
</Grid>
</ScrollView>
</ContentPage.Content>
</ContentPage>
36 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Now, for putting the header elements we are going to use some
nested grids, so, first let’s define a grid like this:
Roboto-Light
Roboto-Bold
Define the styles for the “Title” (row 0), “Subtitle” (row 1),
“CreditCardAllowedIcon” (row 2, column 0), “HeaderIndication” (row
2, column 0) and “SeeRouteButton” (row 2, column 1):
37 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Cool, let’s make the grid, then put the “Title” and “Subtitle” labels
inside it with the following code:
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
38 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
HorizontalOptions="FillAndExpand">
<Grid Padding="20">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource Title}"
<Label
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{DynamicResource Subtitle}"
</Grid>
39 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</yummy:PancakeView>
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
</Grid>
</ScrollView>
</ContentPage.Content>
</ContentPage>
Looking good :
40 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
And, for the button we are going to add a negative margin in the
right to make the effect of “only left right rounded”, export the icon
needed and put it in the row 2 column 1 with the “SeeRoute” style.
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
41 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
HorizontalOptions="FillAndExpand">
<Grid Padding="20">
<Grid.RowDefinitions>
42 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource Title}"
<Label
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{DynamicResource Subtitle}"
<Label
Margin="10,0"
Style="{DynamicResource CreditCardAllowedIcon}"
Text=""
VerticalTextAlignment="Center" />
<Label
Margin="28,0,10,0"
Style="{DynamicResource HeaderIndication}"
43 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
VerticalTextAlignment="Center" />
<yummy:PancakeView
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="38"
HorizontalOptions="Start"
Opacity="0.07"
VerticalOptions="Center"
WidthRequest="180" />
</Grid>
<Button
Grid.Row="2"
Grid.Column="1"
Margin="0,0,-30,0"
ImageSource="route"
Style="{DynamicResource SeeRoute}"
</Grid>
</yummy:PancakeView>
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
44 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</Grid>
</ScrollView>
</ContentPage.Content>
</ContentPage>
45 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Time for the pics (row 1 and 2 of our main grid), the “Pics Layout”
will be a CarouselView with an IndicatorView, see the docs for
initialization setup.
For the rounded corners of the images we need to clip the image to
a PancakeView and use this as the DataTemplate of our
CarouselView, the ItemsSource it’s already defined in the
ViewModel as an ObservableCollection.
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
46 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
HorizontalOptions="FillAndExpand">
<Grid Padding="20">
<Grid.RowDefinitions>
47 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource Title}"
<Label
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{DynamicResource Subtitle}"
<Label
Margin="10,0"
Style="{DynamicResource CreditCardAllowedIcon}"
Text=""
VerticalTextAlignment="Center" />
<Label
Margin="28,0,10,0"
Style="{DynamicResource HeaderIndication}"
48 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
VerticalTextAlignment="Center" />
<yummy:PancakeView
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="38"
HorizontalOptions="Start"
Opacity="0.07"
VerticalOptions="Center"
WidthRequest="180" />
</Grid>
<Button
Grid.Row="2"
Grid.Column="1"
Margin="0,0,-30,0"
ImageSource="route"
Style="{DynamicResource SeeRoute}"
</Grid>
</yummy:PancakeView>
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
49 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<CarouselView
Grid.Row="1"
Margin="20,10"
IndicatorView="indicatorView"
ItemsSource="{Binding Images}">
<CarouselView.ItemTemplate>
<DataTemplate>
<yummy:PancakeView
Margin="0"
Padding="0"
BackgroundColor="LightGray"
CornerRadius="30"
IsClippedToBounds="True">
<Image
Aspect="AspectFill"
HorizontalOptions="FillAndExpand"
Source="{Binding Url}"
VerticalOptions="FillAndExpand" />
</yummy:PancakeView>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<IndicatorView
x:Name="indicatorView"
Grid.Row="2"
50 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
IndicatorColor="LightGray"
SelectedIndicatorColor="DarkGray" />
</Grid>
</ScrollView>
</ContentPage.Content>
</ContentPage>
51 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Cool, let’s make the row 3 of our main grid, the “Services Layout”,
before going to our view, add the following styles:
</Style>
</Style>
</Style>
52 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
53 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</Grid.RowDefinitions>
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
HorizontalOptions="FillAndExpand">
<Grid Padding="20">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource Title}"
<Label
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{DynamicResource Subtitle}"
54 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<Label
Margin="10,0"
Style="{DynamicResource CreditCardAllowedIcon}"
Text=""
VerticalTextAlignment="Center" />
<Label
Margin="28,0,10,0"
Style="{DynamicResource HeaderIndication}"
VerticalTextAlignment="Center" />
<yummy:PancakeView
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="38"
HorizontalOptions="Start"
Opacity="0.07"
VerticalOptions="Center"
WidthRequest="180" />
</Grid>
<Button
Grid.Row="2"
Grid.Column="1"
Margin="0,0,-30,0"
ImageSource="route"
55 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Style="{DynamicResource SeeRoute}"
</Grid>
</yummy:PancakeView>
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
<CarouselView
Grid.Row="1"
Margin="20,10"
IndicatorView="indicatorView"
ItemsSource="{Binding Images}">
<CarouselView.ItemTemplate>
<DataTemplate>
<yummy:PancakeView
Margin="0"
Padding="0"
BackgroundColor="LightGray"
CornerRadius="30"
IsClippedToBounds="True">
<Image
56 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Aspect="AspectFill"
HorizontalOptions="FillAndExpand"
Source="{Binding Url}"
VerticalOptions="FillAndExpand" />
</yummy:PancakeView>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<IndicatorView
x:Name="indicatorView"
Grid.Row="2"
IndicatorColor="LightGray"
SelectedIndicatorColor="DarkGray" />
<yummy:PancakeView
Grid.Row="3"
Margin="20,10"
Padding="20,20,20,30"
BackgroundGradientEndColor="#EEA849"
BackgroundGradientStartColor="#F46B45"
CornerRadius="20"
HorizontalOptions="FillAndExpand">
<StackLayout>
<Label
Margin="0,0,0,20"
57 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Style="{DynamicResource CardTitle}"
Text="Precios" />
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Column="0"
Style="{DynamicResource CardDetail}"
Text="{Binding Name}"
VerticalOptions="Center" />
<Label
Grid.Column="1"
HorizontalOptions="Center"
Style="{DynamicResource CardBoldDetail}"
TextColor="#FFFFFF"
VerticalOptions="Center">
<Label.FormattedText>
<FormattedString>
58 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</FormattedString>
</Label.FormattedText>
</Label>
<yummy:PancakeView
Grid.Column="1"
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="32"
Opacity="0.07" />
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
</StackLayout>
</yummy:PancakeView>
</Grid>
</ScrollView>
</ContentPage.Content>
</ContentPage>
Run the app and go to the motel details, scroll down, you see
this now:
59 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
For the last row, the “Phones Layout”, we are going to do almost
the same, but the gradients colors and the grid inside the
BindableLayout will be different.
<ContentPage
x:Class="CabanasRD.UI.Map.Views.MotelDetailsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
60 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;
assembly=FFImageLoading.Svg.Forms"
xmlns:ios="clr-
namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;
assembly=Xamarin.Forms.Core"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"
ios:NavigationPage.HideNavigationBarSeparator="true"
BackgroundColor="#FFFFFF">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="10">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<yummy:PancakeView
Grid.Row="0"
BackgroundGradientEndColor="#F37335"
BackgroundGradientStartColor="#FDC830"
HorizontalOptions="FillAndExpand">
<Grid Padding="20">
61 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource Title}"
<Label
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{DynamicResource Subtitle}"
<Label
Margin="10,0"
Style="{DynamicResource CreditCardAllowedIcon}"
Text=""
VerticalTextAlignment="Center" />
<Label
62 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Margin="28,0,10,0"
Style="{DynamicResource HeaderIndication}"
VerticalTextAlignment="Center" />
<yummy:PancakeView
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="38"
HorizontalOptions="Start"
Opacity="0.07"
VerticalOptions="Center"
WidthRequest="180" />
</Grid>
<Button
Grid.Row="2"
Grid.Column="1"
Margin="0,0,-30,0"
ImageSource="route"
Style="{DynamicResource SeeRoute}"
</Grid>
</yummy:PancakeView>
<ffimageloadingsvg:SvgCachedImage
Grid.Row="0"
Margin="0"
Aspect="AspectFit"
63 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Source="resource://CabanasRD.Resources.Images.header_shape.svg"
VerticalOptions="End" />
<CarouselView
Grid.Row="1"
Margin="20,10"
IndicatorView="indicatorView"
ItemsSource="{Binding Images}">
<CarouselView.ItemTemplate>
<DataTemplate>
<yummy:PancakeView
Margin="0"
Padding="0"
BackgroundColor="LightGray"
CornerRadius="30"
IsClippedToBounds="True">
<Image
Aspect="AspectFill"
HorizontalOptions="FillAndExpand"
Source="{Binding Url}"
VerticalOptions="FillAndExpand" />
</yummy:PancakeView>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
64 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<IndicatorView
x:Name="indicatorView"
Grid.Row="2"
IndicatorColor="LightGray"
SelectedIndicatorColor="DarkGray" />
<yummy:PancakeView
Grid.Row="3"
Margin="20,10"
Padding="20,20,20,30"
BackgroundGradientEndColor="#EEA849"
BackgroundGradientStartColor="#F46B45"
CornerRadius="20"
HorizontalOptions="FillAndExpand">
<StackLayout>
<Label
Margin="0,0,0,20"
Style="{DynamicResource CardTitle}"
Text="Precios" />
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
65 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</Grid.ColumnDefinitions>
<Label
Grid.Column="0"
Style="{DynamicResource CardDetail}"
Text="{Binding Name}"
VerticalOptions="Center" />
<Label
Grid.Column="1"
HorizontalOptions="Center"
Style="{DynamicResource CardBoldDetail}"
TextColor="#FFFFFF"
VerticalOptions="Center">
<Label.FormattedText>
<FormattedString>
</FormattedString>
</Label.FormattedText>
</Label>
<yummy:PancakeView
Grid.Column="1"
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="32"
66 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
Opacity="0.07" />
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
</StackLayout>
</yummy:PancakeView>
<yummy:PancakeView
Grid.Row="4"
Margin="20,10"
Padding="20,20,20,30"
BackgroundGradientEndColor="#FFE374"
BackgroundGradientStartColor="#F59302"
CornerRadius="20"
HorizontalOptions="FillAndExpand">
<StackLayout>
<Label
Margin="0,0,0,20"
Style="{DynamicResource CardTitle}"
Text="Teléfonos" />
<BindableLayout.ItemTemplate>
<DataTemplate>
67 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label
Grid.Column="0"
Margin="10,0"
HorizontalOptions="Center"
Style="{DynamicResource CardBoldDetail}"
Text="{Binding Number}"
TextColor="#FFFFFF"
VerticalOptions="Center" />
<yummy:PancakeView
Grid.Column="0"
BackgroundColor="#000000"
CornerRadius="16"
HeightRequest="32"
Opacity="0.07" />
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
</StackLayout>
</yummy:PancakeView>
</Grid>
68 of 69 11/28/2020, 4:03 PM
CabañasRD, from native to cross-platform with Xamarin Forms [1/4]. about:reader?url=http://talkwithangel.com/cabanasrd-from-native-to-cr...
</ScrollView>
</ContentPage.Content>
</ContentPage>
One more thing, let’s avoid the Dark mode for now, go to the iOS
project and add the following value to the info.plist:
<key>UIUserInterfaceStyle</key>
<string>Light</string>
69 of 69 11/28/2020, 4:03 PM