How to dynamically adjust positioning of a VerticalStackLayout inside a Grid? - xaml

I'm creating an app using MAUI and I'm trying to make it so an ImageButton and SearchBar nested in a VerticalStackLayout move positioning based on the dynamically created CollectionView.
This is the code for the UI:
<Grid>
<FlexLayout VerticalOptions="Center" HorizontalOptions="Center">
<StackLayout>
<CollectionView x:Name="taskList">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:Task">
<VerticalStackLayout Margin="15">
<Entry Text="{Binding name}" IsReadOnly="True" />
<Entry Text="{Binding departmentsString}" IsReadOnly="True"/>
<HorizontalStackLayout>
<Entry Text="{Binding status}" IsReadOnly="True"/>
<Entry Text="{Binding deadline}" IsReadOnly="True" />
<Entry Text="{Binding author.fullName}" IsReadOnly="True"/>
</HorizontalStackLayout>
<Entry Text="{Binding description}" IsReadOnly="True" />
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>
<VerticalStackLayout Margin="15">
<Entry Placeholder="Name" x:Name="nameTxt"/>
<Entry Placeholder="Department" x:Name="departTxt"/>
<HorizontalStackLayout>
<inputs:SfComboBox x:Name="statusTxt" Placeholder="Status" BackgroundColor="Black" TextColor="Green" DropDownIconColor="Green"/>
<Entry Placeholder="deadline" x:Name="deadlineTxt"/>
<Entry Placeholder="Author" x:Name="authorTxt"/>
</HorizontalStackLayout>
<Entry Placeholder="Description" x:Name="descTxt"/>
</VerticalStackLayout>
</FlexLayout>
<VerticalStackLayout VerticalOptions="Center" >
<SearchBar Placeholder="Search" x:Name="searchBar" TextChanged="searchBar_TextChanged" MaxLength="30" MaximumWidthRequest="200"/>
<ImageButton Aspect="AspectFill" x:Name="addBtn" Source="plus.png" BackgroundColor="Black" Clicked="addBtn_Clicked" HeightRequest="64" WidthRequest="64"/>
</VerticalStackLayout>
</Grid>
I have tried every different type of Layout but nothing works.
What should I do?

Related

Bottom Navigation Bar Design in Dotnet Maui

I am working on a design for Dotnet Maui but not able to achieve the depth as per design.
I have tried box frame but was not been able to achieve the top shadow and circle cut. I have also created this as a floating button.
ContentPage
Grid ->
<HorizontalStackLayout VerticalOptions="End" Margin="0,0,0,10">
<Grid RowDefinitions="22,15" HorizontalOptions="Center" Margin="28,20,10,0">
<ImageButton Source="homeicon.svg"
WidthRequest="20"
HeightRequest="22"
HorizontalOptions="Center"
VerticalOptions="Center"
Grid.Row="0"
/>
<Label Grid.Row="1" Text="Home"
FontFamily="WorkSansRegular"
FontSize="12"
/>
</Grid>
<Grid RowDefinitions="22,15" HorizontalOptions="Center" Margin="28,20,10,0">
<ImageButton Source="wallet.svg"
WidthRequest="20"
HeightRequest="22"
HorizontalOptions="Center"
VerticalOptions="Center"
Grid.Row="0"
/>
<Label Grid.Row="1" Text="Wallet"
FontFamily="WorkSansRegular"
FontSize="12"
/>
</Grid>
<Ellipse Margin="16,-15,0,0"
Fill="#AFAFAF"
StrokeThickness="4"
WidthRequest="70"
HeightRequest="70"
HorizontalOptions="Start"
VerticalOptions="Start"
/>
<ImageButton Source="centericon.svg"
WidthRequest="60"
HeightRequest="62"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="-65,-15,0,0"
/>
<Grid RowDefinitions="22,15" HorizontalOptions="Center" Margin="28,20,0,0">
<ImageButton Source="activityicon.svg"
WidthRequest="20"
HeightRequest="22"
HorizontalOptions="Center"
VerticalOptions="Center"
Grid.Row="0"
/>
<Label Grid.Row="1" Text="Activity" FontFamily="WorkSansRegular"
FontSize="12"
/>
</Grid>
<Grid RowDefinitions="22,15" HorizontalOptions="Center" Margin="28,20,0,0">
<ImageButton Source="profileicon.svg"
WidthRequest="20"
HeightRequest="22"
HorizontalOptions="Center"
VerticalOptions="Center"
Grid.Row="0"
/>
<Label Grid.Row="1" Text="Profile" FontFamily="WorkSansRegular"
FontSize="12"
/>
</Grid>
</HorizontalStackLayout>
this part of the code is under
<ContentPage -> Grid ->

Grid auto hiding in xaml Xamarin Forms

I am getting a strange error /bug. I have 2 buttons (Save and Clear) inside the grid and when user do not enter any data to fields then it shows the errors printed in labels which are in bottom of each controls.
I have used the scroll view and if design goes to the scrolling then my buttons inside the grid hides automatically. But when I select any picker or focus in any Entry then the Grid (Save and Clear) visible in Page.
I have not written any code in the picker selected Index change.
I am sharing me code. and attaching the screenShot of Page Thanks in advance.
<ContentPage.Content>
<ScrollView x:Name="MyScroll">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="10">
<StackLayout>
<Entry Text="{Binding BindProductInvModel.ProductInvID}" Margin="0" FontSize="1" IsVisible="false" HorizontalOptions="FillAndExpand" />
<Label Text="Product Name" Margin="2,-2" FontAttributes="Bold" />
<Picker x:Name="ProductName" Margin="2,-10,2,5" HorizontalOptions="FillAndExpand"
ItemsSource="{Binding BindProductList}"
ItemDisplayBinding="{Binding ProductName}"
SelectedItem="{Binding BindSelectedProduct,Mode=TwoWay}"
Title="{Binding BindCommonDisplayName.PickerTitleDisplayName}"/>
<Label x:Name="ProductIDError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Quanity" Margin="2,-10" FontAttributes="Bold" />
<Entry x:Name="Quantity" Text="{Binding BindProductInvModel.Quantity}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="QuantityError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Unit" Margin="2,-10" FontAttributes="Bold" />
<Entry x:Name="Unit" Text="{Binding BindProductInvModel.Unit}" IsReadOnly="True"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="UnitError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Vendor Name" Margin="2,-10" FontAttributes="Bold" />
<Picker x:Name="VendorName" Margin="2,-5,2,5" ItemsSource="{Binding BindVendorList}"
ItemDisplayBinding="{Binding VendorName}"
SelectedItem="{Binding BindSelectedVendor,Mode=TwoWay}"
Title="{Binding BindCommonDisplayName.PickerTitleDisplayName}" HorizontalOptions="FillAndExpand" />
<Label x:Name="VendorIDError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Receiving Date" Margin="2,-12" FontAttributes="Bold" />
<DatePicker x:Name="PickerRecvDate" Margin="2,-5,2,5" Date="{Binding BindProductInvModel.ReceivingDate,Mode=TwoWay}"
HorizontalOptions="FillAndExpand" Format="dd-MM-yyyy" />
<Label Text="Price" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="Price" Text="{Binding BindProductInvModel.Price}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="PriceError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Fair" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="Fair" Text="{Binding BindProductInvModel.Fair}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="FairError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="OtherCharges" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="OtherCharges" Text="{Binding BindProductInvModel.OtherCharges}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="OtherChargesError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Total"
Margin="2,-12" FontAttributes="Bold" />
<Entry Text="{Binding BindProductInvModel.Total}"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next" IsEnabled="False"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="TotalError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
</StackLayout>
<StackLayout>
<Grid HorizontalOptions="FillAndExpand" Margin="2,-12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Button Text="Save" x:Name="BtnSave"
HorizontalOptions="FillAndExpand" CornerRadius="10"
BorderWidth="2" BackgroundColor="#ff6633" TextColor="#fff"
Margin="2" Grid.Column="0" Grid.Row="0" Command="{Binding SaveCommand}" />
<Button Text="Clear" x:Name="BtnClear" HorizontalOptions="FillAndExpand"
CornerRadius="10" BorderWidth="2" BackgroundColor="#bfbfbf"
TextColor="#fff" Margin="2" Grid.Column="1" Grid.Row="0" Command="{Binding ClearCommand}" />
</Grid>
</StackLayout>
</StackLayout>
</ScrollView>
</ContentPage.Content>
If you want to make the grid with buttons always visable when you scroll or select any picker, you could make the buttons outside the scrollview.
<StackLayout>
<ScrollView x:Name="MyScroll">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="10">
<StackLayout>
<Entry Text="{Binding BindProductInvModel.ProductInvID}" Margin="0" FontSize="1" IsVisible="false" HorizontalOptions="FillAndExpand" />
<Label Text="Product Name" Margin="2,-2" FontAttributes="Bold" />
<Picker x:Name="ProductName" Margin="2,-10,2,5" HorizontalOptions="FillAndExpand"
ItemsSource="{Binding BindProductList}"
ItemDisplayBinding="{Binding ProductName}"
SelectedItem="{Binding BindSelectedProduct,Mode=TwoWay}"
Title="{Binding BindCommonDisplayName.PickerTitleDisplayName}"/>
<Label x:Name="ProductIDError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Quanity" Margin="2,-10" FontAttributes="Bold" />
<Entry x:Name="Quantity" Text="{Binding BindProductInvModel.Quantity}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="QuantityError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Unit" Margin="2,-10" FontAttributes="Bold" />
<Entry x:Name="Unit" Text="{Binding BindProductInvModel.Unit}" IsReadOnly="True"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="UnitError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Vendor Name" Margin="2,-10" FontAttributes="Bold" />
<Picker x:Name="VendorName" Margin="2,-5,2,5" ItemsSource="{Binding BindVendorList}"
ItemDisplayBinding="{Binding VendorName}"
SelectedItem="{Binding BindSelectedVendor,Mode=TwoWay}"
Title="{Binding BindCommonDisplayName.PickerTitleDisplayName}" HorizontalOptions="FillAndExpand" />
<Label x:Name="VendorIDError" Margin="2,-10,2,5" TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Receiving Date" Margin="2,-12" FontAttributes="Bold" />
<DatePicker x:Name="PickerRecvDate" Margin="2,-5,2,5" Date="{Binding BindProductInvModel.ReceivingDate,Mode=TwoWay}"
HorizontalOptions="FillAndExpand" Format="dd-MM-yyyy" />
<Label Text="Price" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="Price" Text="{Binding BindProductInvModel.Price}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="PriceError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Fair" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="Fair" Text="{Binding BindProductInvModel.Fair}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="FairError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="OtherCharges" Margin="2,-12" FontAttributes="Bold" />
<Entry x:Name="OtherCharges" Text="{Binding BindProductInvModel.OtherCharges}" Unfocused="Entry_Unfocused" Focused="Entry_Focused"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="OtherChargesError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
<Label Text="Total"
Margin="2,-12" FontAttributes="Bold" />
<Entry Text="{Binding BindProductInvModel.Total}"
Margin="2,-5,2,5" WidthRequest="150" ReturnType="Next" IsEnabled="False"
HorizontalOptions="FillAndExpand" Keyboard="Numeric" />
<Label x:Name="TotalError" Margin="2,-10,2,5"
TextColor="Red" IsVisible="false" FontAttributes="Italic" />
</StackLayout>
</StackLayout>
</ScrollView>
<StackLayout>
<Grid HorizontalOptions="FillAndExpand" Margin="2,-12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Button Text="Save" x:Name="BtnSave"
HorizontalOptions="FillAndExpand" CornerRadius="10"
BorderWidth="2" BackgroundColor="#ff6633" TextColor="#fff"
Margin="2" Grid.Column="0" Grid.Row="0" Command="{Binding SaveCommand}" />
<Button Text="Clear" x:Name="BtnClear" HorizontalOptions="FillAndExpand"
CornerRadius="10" BorderWidth="2" BackgroundColor="#bfbfbf"
TextColor="#fff" Margin="2" Grid.Column="1" Grid.Row="0" Command="{Binding ClearCommand}" />
</Grid>
</StackLayout>
</StackLayout>
It was a bug workaround:
Wrapping the ScrollView in a ContentView seems to be a good workaround.
<ContentPage.Content>
<ContentView>
<ScrollView VerticalOptions="FillAndExpand">
<StackLayout>
<!-- Content -->
</StackLayout>
</ScrollView>
</ContentView>
</ContentPage.Content>
https://github.com/xamarin/Xamarin.Forms/issues/13597

Xamarin Forms Frame in Android

I have four frames, I want to enter in that number. When running on Windows, the numbers are fully visible, but when I run on Android, numbers are not visible or half appear.
I do not want to change outlines so that they get out of shape
And change their appearance
I'm beginner in xamarin
Please advise me to display the numbers correctly while running on Android without changing the appearance of my frames.
XAML:
<Style TargetType="Frame" >
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="CornerRadius" Value="15"/>
<Setter Property="HeightRequest" Value="30"/>
<Setter Property="BorderColor" Value="Blue"/>
<Setter Property="Margin" Value="3"/>
</Style>
</ContentPage.Resources>
<StackLayout BackgroundColor="White" Orientation="Vertical" >
<Image Source="d.png" WidthRequest="60" HeightRequest="60" Margin="0,5,0,5"/>
<BoxView WidthRequest="40" HeightRequest="60" BackgroundColor="Pink" HorizontalOptions="Center"/>
<Label Text="کد ارسال شده را اینجا وارد کنید" TextColor="Black" FontSize="15" HorizontalOptions="Center" Margin="0,5,0,0"
VerticalOptions="Center"/>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" Spacing="10" BackgroundColor="White">
<Frame WidthRequest="80" x:Name="frame1" >
<Entry Keyboard="Numeric" TextColor="Black" FontSize="20" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" MaxLength="1"
HorizontalTextAlignment="Center" Focused="Entry_Focused" Unfocused="Entry_unFocused" />
</Frame>
<Frame WidthRequest="80" x:Name="frame2" >
<Entry Keyboard="Numeric" TextColor="Black" FontSize="20" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
HorizontalTextAlignment="Center" MaxLength="1" Focused="Entry_Focused1" Unfocused="Entry_unFocused1" />
</Frame>
<Frame WidthRequest="80" x:Name="frame3" >
<Entry Keyboard="Numeric" TextColor="Black" FontSize="20" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
HorizontalTextAlignment="Center" Focused="Entry_Focused2" Unfocused="Entry_unFocused2" MaxLength="1" />
</Frame>
<Frame WidthRequest="80" x:Name="frame4"
>
<Entry Keyboard="Numeric" FontSize="20" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
MaxLength="1" HorizontalTextAlignment="Center" Focused="Entry_Focused3" Unfocused="Entry_unFocused3" />
</Frame>
</StackLayout>
<Button x:Name="Button" Text="تایید" TextColor="White" BackgroundColor="Green" HorizontalOptions="Center"
VerticalOptions="End" WidthRequest="340" HeightRequest="50" CornerRadius="5" Margin="0,10,0,10"/>
</StackLayout>
You can set the specific heightrequest for android in the Frame
Here is running screenshot in android.
Here is code.
<Frame x:Name="frame1" WidthRequest="80" >
<Entry Keyboard="Numeric" TextColor="Black" FontSize="20" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" MaxLength="1"
HorizontalTextAlignment="Center" Focused="Entry_Focused" Unfocused="Entry_Unfocused" >
</Entry>
<Frame.HeightRequest>
<OnPlatform Android="50" ></OnPlatform>
</Frame.HeightRequest>
</Frame>

How to use Grid and create this?

i would like to create a view like this :
. Where Contact1, Contact2 are models and ListViewis a list of these models.
Now i have code like this but i dont get the desired output.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="KiaiDay.Pages.ConviteEmailPage"
NavigationPage.TitleView="Convive por email"
NavigationPage.HasBackButton="True"
NavigationPage.BackButtonTitle="Voltar"
BackgroundColor="AliceBlue">
<ContentPage.Content>
<AbsoluteLayout>
<ActivityIndicator x:Name="indicador" AbsoluteLayout.LayoutBounds="0.5,0.5,100,100" AbsoluteLayout.LayoutFlags="PositionProportional" Color="Blue"/>
<StackLayout>
<ListView x:Name="ListaContactos">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Image Source="{Binding Imagem}"/>
<Label Text="{Binding Nome}"/>
<Label Text="{Binding Email}"/>
<Label Text="{Binding Numero}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
As Jason said, you can use CollectionView to do it.However,you should note that:
The CollectionView is currently an early preview, and lacks much of its planned functionality. In addition, the API will change as the implementation is completed.
And CollectionView is available in Xamarin.Forms 4.0-pre1.
If no problem with version, using code as follow:(Update: Adding Frame to code)
<StackLayout Margin="20,35,20,20">
<CollectionView ItemsSource="{Binding Monkeys}" >
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="2" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout Padding="10">
<Frame BackgroundColor="LightGray"
OutlineColor="Black"
CornerRadius="10">
<Grid Padding="5" WidthRequest="120" HeightRequest="120">
<Grid.RowDefinitions>
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0"
Text="{Binding Name}"
FontAttributes="Bold"
LineBreakMode="TailTruncation" />
<Image Grid.Row="1"
Source="{Binding ImageUrl}"
Aspect="AspectFill"
HeightRequest="60"
WidthRequest="60" />
<Label Grid.Row="2"
Text="{Binding Location}"
LineBreakMode="TailTruncation"
FontAttributes="Italic"
VerticalOptions="End" />
<Label Grid.Row="3"
Text="{Binding Details}"
LineBreakMode="TailTruncation"
FontAttributes="Italic"
VerticalOptions="End" />
</Grid>
</Frame>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>
Refer to official sample , binding source:
BindingContext = new MonkeysViewModel();
Here is the capture image of app.

The property 'Content' is set more than once Xamarin Forms

I added ContentView xaml file in xamarin.forms project, but it showing annoying warning
The property 'Content' is set more than once.
Below my ContentView.xaml file
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinTestList.View.AddContect">>
<StackLayout Spacing="12">
<Entry x:Name="txtContactName" Text="{Binding Name}" HeightRequest="40" BackgroundColor="White" Placeholder="Contact Name" HorizontalOptions="FillAndExpand"/>
<Entry x:Name="txtMobileNumber" Keyboard="Telephone" Text="{Binding MobileNumber}" BackgroundColor="White" HeightRequest="40" Placeholder="Mobile Number" HorizontalOptions="FillAndExpand"/>
<StackLayout Orientation="Horizontal">
<Entry x:Name="txtAge" Text="{Binding Age}" HeightRequest="40" BackgroundColor="White" Placeholder="Age" HorizontalOptions="FillAndExpand"/>
<Picker x:Name="GenderPicker" SelectedItem="{Binding Gender}" Title="Gender" BackgroundColor="White" HeightRequest="40" HorizontalOptions="FillAndExpand">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Male</x:String>
<x:String>FeMale</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</StackLayout>
<DatePicker x:Name="txtDOB" Date="{Binding DOB}" BackgroundColor="White" HeightRequest="40" HorizontalOptions="FillAndExpand"/>
<Entry x:Name="txtAddress" Text="{Binding Address}" BackgroundColor="White" HeightRequest="40" Placeholder="Address" HorizontalOptions="FillAndExpand"/>
</StackLayout>
</ContentView>
Warning screenshot:
Maybe because your ContentView has two '>' at the end?