<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>xamarin &#8211; achraf ben alaya</title>
	<atom:link href="https://achrafbenalaya.com/category/blog/xamarin/feed/" rel="self" type="application/rss+xml" />
	<link>https://achrafbenalaya.com</link>
	<description>Tech Blog By Achraf Ben Alaya</description>
	<lastBuildDate>Thu, 03 Dec 2020 07:55:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>

<image>
	<url>/wp-content/uploads/2022/02/cropped-me-scaled-1-32x32.jpeg</url>
	<title>xamarin &#8211; achraf ben alaya</title>
	<link>https://achrafbenalaya.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">189072172</site>	<item>
		<title>Animations with Lottie in Xamarin Forms</title>
		<link>https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=animations-with-lottie-in-xamarin-forms</link>
					<comments>https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sun, 26 Apr 2020 20:59:39 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=469</guid>

					<description><![CDATA[Animations with Lottie in Xamarin Forms Days ago , I have been trying to add some animation to one of my applications ,and I was fascinated when I found Lottie . First , what is Lottie ? Lottie is a library, designed for iOS, Android and React Native, by Airbnb, that allows you to run [&#8230;]]]></description>
			<link rel='stylesheet' id='jnews-previewslider-css' href='/wp-content/plugins/jnews-gallery/assets/css/previewslider.css' type='text/css' media='all' />
<link rel='stylesheet' id='jnews-previewslider-responsive-css' href='/wp-content/plugins/jnews-gallery/assets/css/previewslider-responsive.css' type='text/css' media='all' />
<script type="text/javascript" src="https://c0.wp.com/c/6.7.5/wp-includes/js/jquery/jquery.min.js" id="jquery-core-js"></script>
<script type="text/javascript" src="https://c0.wp.com/c/6.7.5/wp-includes/js/jquery/jquery-migrate.min.js" id="jquery-migrate-js"></script>
<script type="text/javascript" src="/wp-content/plugins/jnews-gallery/assets/js/jquery.previewslider.js" id="jnews-previewslider-js"></script>
							<content:encoded><![CDATA[<p>Animations with Lottie in Xamarin Forms</p>
<p>Days ago , I have been trying to add some animation to one of my applications ,and I was fascinated when I found Lottie .</p>
<p>First , what is Lottie ?</p>
<p>Lottie is a library, designed for iOS, Android and React Native, by Airbnb, that allows you to run animations. These animations are defined in a JSON file, containing all the details of colors, shapes, transforms and more. These JSON files are created by Adobe After Effects. However, many designers have been happy to share their works, and you can access pre-built animations at LottieFiles.</p>
<p>Now , for me , what is more amazing than animation , is “Featured animations from community” ! You know why people are awesome ! people contribute to Lottie Files everyday, and just now I have found new awesome animations that I will spend some time after writing this post to see if I may need one of them .</p>
<p>Let’s see what are we going to build ! For our demo application I didn’t only just use Lottie plugin but I also used another plugin called Rg.Plugins.Popup to present the animation in a more beautiful way . now let’s see the</p>
<p>Demo :</p>

<a href='https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/anim3/'><img decoding="async" width="150" height="300" src="/wp-content/uploads/2020/04/anim3-150x300.gif" class="attachment-medium size-medium" alt="" srcset="/wp-content/uploads/2020/04/anim3-150x300.gif 150w, /wp-content/uploads/2020/04/anim3-512x1024.gif 512w" sizes="(max-width: 150px) 100vw, 150px" /></a>
<a href='https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/anim1/'><img decoding="async" width="150" height="300" src="/wp-content/uploads/2020/04/anim1-150x300.gif" class="attachment-medium size-medium" alt="" srcset="/wp-content/uploads/2020/04/anim1-150x300.gif 150w, /wp-content/uploads/2020/04/anim1-512x1024.gif 512w" sizes="(max-width: 150px) 100vw, 150px" /></a>
<a href='https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/anim2/'><img decoding="async" width="150" height="300" src="/wp-content/uploads/2020/04/anim2-150x300.gif" class="attachment-medium size-medium" alt="" srcset="/wp-content/uploads/2020/04/anim2-150x300.gif 150w, /wp-content/uploads/2020/04/anim2-512x1024.gif 512w" sizes="(max-width: 150px) 100vw, 150px" /></a>

<p>Now As you can see , using some animations can make your app look prettier and the user can understand his actions more easily .</p>
<p>How to use Lottie and Popup ? As I said before , I used two plugins , Lottie and Rg.Plugins.Popup . First let’s start by adding Lottie plugin by simply installing it to our solution :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/45.png" width="1024" height="438" /></p>
<p>As you can see there is a lot of Lottie plugins , when using xamarin.forms you should focus on Com.Airbnb.Xamarin.Forms.Lottie , here I’m using the latest stable and available version 3.0.0 .</p>
<p>now all you need is to download an animation file , which is a json file from Lottie website :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/46.png" width="768" height="493" /></p>
<p>and after that, you should put that file inside the Assets folder in android project and inside Resources folder in Ios project.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/47.png" width="467" height="393" /></p>
<p>Now , simply , to use one of those files you need to add this bloc of code</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;forms:AnimationView x:Name="AnimationView"
  IsPlaying="True"
   Animation="gift-box.json"
  Loop="True"
  AutoPlay="True"
  VerticalOptions="FillAndExpand"
  HorizontalOptions="FillAndExpand" /&gt;</pre>
<p>You can then control the animation , such as AutoPlay,Loop and IsPlaying so you can control the behavior of your application . Just like that , we have created a simple animation that you can include inside any page inside your project. now , let’s install the Rg.Plugins.Popup :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/48.png" width="1024" height="411" /></p>
<p>At this time , the available version is 1.1.5.188 . now after installing the nuget , there is some more work to do . The plugin requires to be initialized. To use a PopupPage inside an application, each platform application must initialize the Rg.Plugins.Popup. This initialization step varies from a platform to another : Android : You need to add ” Rg.Plugins.Popup.Popup.Init(this, bundle);” as in the picture below</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/49.png" width="629" height="192" /></p>
<p>On iOS</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post10/50.png" width="599" height="145" /></p>
<p>&nbsp;</p>
<p>and like that , we have prepared our environment to use our plugin . now we need to create a PopupPage (You can read more details about it in this <a href="https://github.com/rotorgames/Rg.Plugins.Popup/wiki/PopupPage">link</a>)</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
            &lt;pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
             xmlns:forms="clr-namespace:Lottie.Forms;assembly=Lottie.Forms"
                mc:Ignorable="d"
                x:Class="LottieListTest.Views.PopupPageSentEmail"&gt;
                &lt;Frame CornerRadius="20" 
                 BackgroundColor="GhostWhite" 
                HorizontalOptions="CenterAndExpand" 
                VerticalOptions="CenterAndExpand"
                 x:Name="AnimationFrame"&gt;
                    &lt;StackLayout Spacing="10"&gt;
                        &lt;forms:AnimationView x:Name="AnimationView"
                            Animation="91-mailsent.json"
                            Loop="True"
                            AutoPlay="True"
                            WidthRequest="150" HeightRequest="150"
                            VerticalOptions="FillAndExpand"
                            HorizontalOptions="FillAndExpand" /&gt;
                       &lt;Label Text="Sent!" HorizontalTextAlignment="Center"/&gt;
                         &lt;/StackLayout&gt;
                         &lt;/Frame&gt;
                        &lt;/pages:PopupPage&gt;</pre>
<p>now , after creating the PopupPage , we need to call it from our main page</p>
<p>await PopupNavigation.PushAsync(new PopupPageSentEmail()); We have, at end, created a beautiful simple addition to our project that will make it look better .</p>
<p>You can find the whole project , with the apk file so you can test it on your android phone inside the project on github from this link. Sorry iOS users , I don’t have neither a Mac or Iphone .</p>
<p>https://github.com/achrafbenalaya/xamarinformsaniamtion/blob/master/LottieListTest/Imagesandapk/com.companyname.lottielisttest-Signed.apk</p>
<p><iframe title="Animations with Lottie for Xamarin Forms" width="500" height="281" src="https://www.youtube.com/embed/y_gt7x_-IGg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/04/26/animations-with-lottie-in-xamarin-forms/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">469</post-id>	</item>
		<item>
		<title>Font Awesome ,Bootstrap and Material Font Icons For Xamarin.Forms</title>
		<link>https://achrafbenalaya.com/2020/04/26/font-awesome-bootstrap-and-material-font-icons-for-xamarin-forms/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=font-awesome-bootstrap-and-material-font-icons-for-xamarin-forms</link>
					<comments>https://achrafbenalaya.com/2020/04/26/font-awesome-bootstrap-and-material-font-icons-for-xamarin-forms/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sun, 26 Apr 2020 20:47:23 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=466</guid>

					<description><![CDATA[Font Awesome ,Bootstrap and Material Font Icons For Xamarin.Forms July 21, 2019 by ben2code My entire time , using xamarin forms to develop mobile applications , I was using Images and specific Icons. I was generating those icons using google Asset Studio . Well , that was helpful , but there was a lot of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Font Awesome ,Bootstrap and Material Font Icons For Xamarin.Forms July 21, 2019 by ben2code My entire time , using xamarin forms to develop mobile applications , I was using Images and specific Icons. I was generating those icons using google Asset Studio .</p>
<p>Well , that was helpful , but there was a lot of waste of time even if google asset studio was there for us . I mean , choosing the right picture , using the google asset studio to generate pictures for @1x, @2x, @3x, hdpi, xhdpi, xxhdi , later adding those picture to each folder and If you didn’t like the picture you should generate new ones.</p>
<p>What about one file and one source ? A file that contains a lot of icons that you can access them with a specific code.</p>
<p>In font awesome you can find more than 1500 free icons that you can use .</p>
<p>In this article , we will not only use font awesome , but we are going to use Bootstrap and Material Font Icons too and we are going to see :</p>
<p>How to get the Fonts . How to add the fonts to Xamarin.Forms Project . How to use Xaml to call the fonts . Demo APP with Source Code . How to get the Fonts First we are going to get the font awesome Font , from this Link you can download the zip file , extract it and get the otf file . Next , we are going to download glyph icons file ” glyphicons-halflings-regular.ttf ” from this Link . Finally we get Material design font icons from this Link.</p>
<p>Now if you have those 5 files , like in picture below , you are ready for the next step .</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/01.png" width="269" height="151" /></p>
<p>Adding the fonts to Xamarin.Forms Project Now , after getting our files , we need to place them in :</p>
<p>Android: Make sure to paste those file to Assets folder .</p>
<p>UWP : Make sure to paste those file to Assets folder .</p>
<p>iOS : Make sure to paste those file to Resources folder and edit the info.plist file by adding :</p>
<p>Using Xaml to call the fonts Now lets start using our fonts in Xaml , first , we are going to use font awesome . now , let’s get the font that we need to use by copying the code like in the picture below</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/02.png" width="1024" height="487" /></p>
<p>Now all you have to do is to past that code between &amp;#x and (<img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> just like in the picture below inside Text, and as you can see , you can specify font size too .</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/03.png" width="943" height="297" /></p>
<p>Now ,let’s use Material Design , and for that we are going to use a website to get the codes that we are going to use for our font as the past example . You need to upload the Material design file to this <strong>website</strong> to get the Icons like this :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/04.png" width="1024" height="601" /></p>
<p>Last we are going to use Bootstrap , for that I used w3schools to get all the font as you can see .</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/05.png" width="1024" height="581" /></p>
<p>and simply , you should just use the code you found in there and place it inside Text .</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post7/06.png" width="544" height="121" /></p>
<p>and simply after doing these steps , you can see inside your app icons like in this demo</p>
<div></div>
<div>
<p><iframe title="Font Awesome ,Bootstrap and Material Font Icons For Xamarin.Forms" width="500" height="281" src="https://www.youtube.com/embed/y93b3NJXT7Y?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>You can read more about Using Font Icons in this blog post by James Montemagno .</p>
<p>You can get the full code source from thins <a href="https://github.com/achrafbenalaya/Adding-Icons-for-Xamarin.Forms"><strong>link</strong></a> .</p>
</div>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/04/26/font-awesome-bootstrap-and-material-font-icons-for-xamarin-forms/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">466</post-id>	</item>
		<item>
		<title>Xamarin.forms,Blazor and Web API</title>
		<link>https://achrafbenalaya.com/2020/04/26/xamarin-formsblazor-and-web-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xamarin-formsblazor-and-web-api</link>
					<comments>https://achrafbenalaya.com/2020/04/26/xamarin-formsblazor-and-web-api/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sun, 26 Apr 2020 16:38:29 +0000</pubDate>
				<category><![CDATA[xamarin]]></category>
		<category><![CDATA[blazor]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=443</guid>

					<description><![CDATA[After the success of past video and blog post of Blazor Write C# instead of JavaScript to Build a Client-Side Single-Page App I decided to create a cross platform application using xamarin.forms Even though i was sick ,and after few of tries , I managed to create a video to demonstrate how we can consume [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>After the success of past video and blog post of Blazor Write C# instead of JavaScript to Build a Client-Side Single-Page App I decided to create a cross platform application using xamarin.forms</p>
<p>Even though i was sick ,and after few of tries , I managed to create a video to demonstrate how we can consume the service that we have created and how I created the mobile application .</p>
<p>First , If you want to see what are we building , you can watch the video below .</p>
<p><iframe title="Building an ASP.NET Core/Blazor/Xamarin Application" width="500" height="281" src="https://www.youtube.com/embed/Vg1SHXQC6tw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>Now , We are going to see step by step how we can :</p>
<p>How we can use conveyor to Access and test your web application from other devices, such as phones, tablets and computers, locally or over the web. Consume to Web Service Using Postman. Create the xamarin forms project. Create the Dataservice &amp; use Mvvm . Next Steps. Conveyor Usually , when I create a web service , I deploy it to my azure account but this time and for some reasons , I wanted to test it on my localhost , but as you know you can’t just simply access that localhost from another computer or smartphone .</p>
<p>So when I was looking around for some solutions , which one of them was changing the configuration inside the applicationhost.config by changing :</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;bindings&gt;
               &lt;binding protocol="http" bindingInformation="*:51889:localhost" /&gt;
               &lt;binding protocol="https" bindingInformation="*:44351:localhost" /&gt;
       &lt;/bindings&gt;
       &lt;bindings&gt;
           &lt;binding protocol="http" bindingInformation="*:51889:localhost" /&gt;
           &lt;binding protocol="http" bindingInformation="*:44351:pc-hostname" /&gt;
           &lt;binding protocol="http" bindingInformation="*:44351:10.0.1.10" /&gt;
       &lt;/bindings&gt;</pre>
<p>Well this worked once , but after a while for some reasons It did stop and that’s when I found <a href="https://conveyor.cloud/">conveyor</a>.</p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/01.png" width="743" height="579" /></p>
<p>You can download the template from visual studio marketplace from this Link. Now after installing the template you have to restart visual studio (Make sure you run it as Administrator). next , you need to run the solution and clique on :</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/02.png" width="482" height="257" /></p>
<p>You can have more details by visiting Conveyor website or by watching their full demo .</p>
<div></div>
<div>
<h3 id="testing-our-web-api" class="post-content-header">Testing our Web Api :</h3>
<p>So last time we have created our Web Api and before going to consume the web-service , I always prefer to test it using postman .</p>
<p>The Postman is the most popular and the most powerful HTTP client for testing the restful web services. Postman makes it easy to test the Restful Web APIs, as well as it develops and documents Restful APIs by allowing the users to quickly put together both simple and complex HTTP requests. The Postman is available as both a Google Chrome in-browser app and Google Chrome Packaged App.</p>
</div>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/03.png" width="1024" height="585" /></p>
<p>After checking that everything working fine and our calls to the Web-Api respond as we want now we can go and create our mobile application .</p>
<p>Xamarin Forms Project So first what is Xamarin forms ? Xamarin.Forms is an open source cross-platform framework from Microsoft for building iOS, Android, &amp; Windows apps with .NET from a single shared codebase. You can read more about xamarin forms from this documentation. now Let’s create our project :</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/04.png" width="992" height="668" /></p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/05.png" width="1012" height="697" /></p>
<p>Since we need a menu , cause we have a list of doctors ,gender ,patient ,and to move around between those menus we should use the Master-Detail template . now , after choosing the right template , we will have a solution that contain 3 project ,the main project where we are going to create most of our code , an android project and and ios project as in picture below .</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/06.png" width="706" height="337" /></p>
<p>Now , before doing anything , we need to update all the packages installed in our solution by going to manage nuget packages for solution and updating all the nuget packages there and building the project . If we have a successful build , now we can start coding .</p>
<p>As I said ,we are going to use Mvvm . now what is Mvvm ? MVVM is a design pattern used to decouple user-interface (view), data (model), and application logic (view model). Xamarin has built-in support for the MVVM pattern including data binding, making it easy to follow this design pattern so that you can create application code that’s better tested and easier to extend without requiring radical changes . You can read more about it here .</p>
<p>So , now we are going to create four folder , Models ,Views and ViewModels and one for the dataservices. In our Modules folder ,we are going to create our modules , and for demo sample , we are going to use the gender class.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">public class Genders
{
    public int GendersId { get; set; }
    public string Name { get; set; }
    public bool IsVisible { get; set; }
    public string Urd { get; set; }

}
</pre>
<p>Next , Inside our ViewModels folder we are going to create three classes , GendersViewModel , EditGenderViewModel and AddGenderViewModel .</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">public class GendersViewModel :BaseViewModel
{
     private List&lt;Genders&gt; _genders1;
    private  DataServices _dataServices = new DataServices();
    private bool _isRefresh;


    public List&lt;Genders&gt; _genders
    {
        get { return _genders1;}
        set  {

        _genders1 = value;
        OnPropertyChanged();

            }
        }

    public GendersViewModel()
    {
        GetGenders();
        
    }

    public bool isRefresh
    {
        get {return _isRefresh; }
        set
        {
            _isRefresh = value;
            OnPropertyChanged();
        } 
    }

    public ICommand GetGendersCOmmand =&gt; new Command(async () =&gt;

    {
        isRefresh = true;
        await GetGenders();
        isRefresh = false;
    });

    private async Task GetGenders()

    {
        _genders = await _dataServices.GetGenders();

    }

}
    public  class EditGenderViewModel
{
    public Genders TheSelectedGender { get; set; }
    private DataServices _dataServices = new DataServices();

    public ICommand EditGendersCOmmand =&gt; new Command(async () =&gt;

    {
        TheSelectedGender.Urd = System.DateTime.Now.ToShortDateString();
        await _dataServices.PutGenders(TheSelectedGender.GendersId, TheSelectedGender);

    });


    public ICommand DeleteGendersCOmmand =&gt; new Command(async () =&gt;

    {
       
        await _dataServices.DeleteGenders(TheSelectedGender.GendersId);


    });

}
public class AddGenderViewModel
{
    public Genders TheSelectedGender { get; set; }
    private DataServices _dataServices = new DataServices();

    public AddGenderViewModel()
    {
        TheSelectedGender = new Genders();
    }

    public ICommand sendGendersCOmmand =&gt; new Command(async () =&gt;

    {
        TheSelectedGender.Urd = System.DateTime.Now.ToShortDateString();
        await _dataServices.PostGenders(TheSelectedGender);
    });


}


     public class DataServices

     {

   private string GenderUrl = Constants.GenderLink;

  #region Genders


    public async Task&lt;List&lt;Genders&gt;&gt; GetGenders()
    {

        var HttpClient = new HttpClient();
        var Json= await HttpClient.GetStringAsync(GenderUrl);
        var Genders = JsonConvert.DeserializeObject&lt;List&lt;Genders&gt;&gt;(Json);

        return Genders;
    }

    public async Task PostGenders(Genders genders)

    {

        var httpClient = new HttpClient();
        var jsonObject = JsonConvert.SerializeObject(genders);
        StringContent content =new StringContent(jsonObject);
        content.Headers.ContentType= new MediaTypeHeaderValue("application/json");
        var result=  await httpClient.PostAsync(GenderUrl, content);

    }

    public async Task PutGenders(int id,Genders genders)

    {

        var httpClient = new HttpClient();
        var jsonObject = JsonConvert.SerializeObject(genders);
        StringContent content = new StringContent(jsonObject);
        content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
        var result = await httpClient.PutAsync(GenderUrl+id, content);

    }

    public async Task DeleteGenders(int id)
    {

        var HttpClient = new HttpClient();
        var responsen = await HttpClient.DeleteAsync(GenderUrl+id);

       // return Genders;
    }

    #endregion</pre>
<p>Now our moduels and viewModules are ready , we need to create our views , by that I mean our pages For our blog , we are going only to create the GenderPage which will contain the list genders .</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;ContentPage.BindingContext&gt;

    &lt;viewModels:GendersViewModel&gt;&lt;/viewModels:GendersViewModel&gt;

&lt;/ContentPage.BindingContext&gt;


&lt;ContentPage.ToolbarItems&gt;
    &lt;ToolbarItem Text="Add" Clicked="GoToAddGender" /&gt;
&lt;/ContentPage.ToolbarItems&gt;


&lt;ListView
x:Name="GenderListView"
HasUnevenRows="True"
ItemsSource="{Binding _genders}"
ItemTapped="GenderListView_OnItemTapped"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding GetGendersCOmmand}"
IsRefreshing="{Binding isRefresh}"&gt;
&lt;ListView.Header&gt;
    &lt;Grid &gt;
        &lt;Grid.ColumnDefinitions&gt;
            &lt;ColumnDefinition Width="*" /&gt;
            &lt;ColumnDefinition Width="*"/&gt;
            &lt;ColumnDefinition Width="*"/&gt;
            &lt;ColumnDefinition Width="*"/&gt;
            &lt;/Grid.ColumnDefinitions&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="Auto" /&gt;
        &lt;/Grid.RowDefinitions&gt;
            &lt;Label Text="ID"  TextColor="Red" FontSize="Small" Grid.Column="0" Grid.Row="0"  HorizontalOptions="Center"/&gt;
            &lt;Label Text="Name" TextColor="Red" Grid.Column="1" Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Center"/&gt;
            &lt;Label Text="Urd" TextColor="Red" Grid.Column="2" Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Center"/&gt;
            &lt;Label Text="Visible" TextColor="Red" Grid.Column="3" Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Center"&gt;&lt;/Label&gt;
        &lt;/Grid&gt;
&lt;/ListView.Header&gt;
&lt;ListView.ItemTemplate&gt;
    &lt;DataTemplate&gt;
    &lt;ViewCell&gt;


&lt;Grid Padding="10"&gt;
    &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition /&gt;
        &lt;ColumnDefinition /&gt;
        &lt;ColumnDefinition /&gt;
        &lt;ColumnDefinition /&gt;

    &lt;/Grid.ColumnDefinitions&gt;
                    &lt;Label Text="{Binding GendersId}" Grid.Column="0" HorizontalOptions="CenterAndExpand" VerticalOptions="Center"&gt;&lt;/Label&gt;
                    &lt;Label Text="{Binding Name}"  Grid.Column="1"  HorizontalOptions="CenterAndExpand"  VerticalOptions="Center"&gt;&lt;/Label&gt;
                    &lt;Label Text="{Binding Urd}"  Grid.Column="2"  HorizontalOptions="CenterAndExpand" VerticalOptions="Center"&gt;&lt;/Label&gt;
                    &lt;CheckBox IsChecked="{Binding IsVisible}" IsEnabled="False"  Grid.Column="3"  HorizontalOptions="CenterAndExpand" VerticalOptions="Center"&gt;&lt;/CheckBox&gt;

                &lt;/Grid&gt;

    &lt;/ViewCell&gt;


&lt;/DataTemplate&gt;

&lt;/ListView.ItemTemplate&gt;
&lt;/ListView&gt;</pre>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">private async void GoToAddGender(object sender, EventArgs e) { await Navigation.PushAsync(new AddGender()); }

    private void GenderListView_OnItemTapped(object sender, ItemTappedEventArgs e)
    {
      var _Genders=  e.Item as Models.Genders;
      Navigation.PushAsync(new EditGenders(_Genders));
    }</pre>
<p>Now , as you can see , we are binding to GendersViewModel were can all our commands. And like that we will have this page .</p>
<p>Now, for the next steps , I decided to enhance the ui for the web app and the mobile app too ,hide elements when isvisibe is set to false and use DataGrid for both projects .</p>
<p>I hope this was helpful , you can find the full code inside my github <a href="http://bit.ly/2PzkrXD">repo </a>.</p>
<p><img loading="lazy" decoding="async" class="alignleft " src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/07.jpg" width="301" height="602" /></p>
<p><img loading="lazy" decoding="async" class="alignleft" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post13/08.jpg" width="303" height="606" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/04/26/xamarin-formsblazor-and-web-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">443</post-id>	</item>
		<item>
		<title>Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .</title>
		<link>https://achrafbenalaya.com/2020/04/21/why-you-need-to-ensure-updating-your-xamarin-android-application-to-supports-64-bit-devices-and-how-to-do-that/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-you-need-to-ensure-updating-your-xamarin-android-application-to-supports-64-bit-devices-and-how-to-do-that</link>
					<comments>https://achrafbenalaya.com/2020/04/21/why-you-need-to-ensure-updating-your-xamarin-android-application-to-supports-64-bit-devices-and-how-to-do-that/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Tue, 21 Apr 2020 21:56:42 +0000</pubDate>
				<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=425</guid>

					<description><![CDATA[Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that . On July 9, 2019 , Like every app developer that has an application on play store , I received this email from google with a subject : Action required: Update your apps to be 64-bit compliant [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .</p>
<p>On July 9, 2019 , Like every app developer that has an application on play store , I received this email from google with a subject : Action required: Update your apps to be 64-bit compliant by August 1, 2019 .</p>
<p>After reading the headline, I was worried a bit , what does this mean ? and why do I need to update it by August 1st 2019 ?</p>
<p>Let’s start by reading and understanding the Email .</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post8/01.png" width="703" height="648" /></p>
<p>Now after reading this email , we understand that From August 1st this year, all new apps and app updates that include native code must have 64-bit versions as well as 32-bit versions when publishing to Google Play.</p>
<p>But , Starting from August 1st, 2021, Google Play won’t serve apps without 64-bit versions on 64-bit capable devices. Users with 64-bit devices simply won’t only see 32-bit apps in Google Play,but also games built with Unity 5.6 or older.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post8/02.png" width="940" height="529" /></p>
<p>Now how to make sure that our Xamarin.android app is up to date with this change .</p>
<p>First , you need to select your android project and clique properties and then you need to go to android option :</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post8/03.png" width="992" height="422" /></p>
<p>After that you need to clique on Advanced and at least you need to choose : armeabi-v7a and arm64-v8a .</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://achrafbenalaya.github.io/Achrafbenalayablog/img/post8/04.png" width="1091" height="546" /></p>
<p>Now as you can see , I’m in Debug mode , you should make sure to do that on release mode too .</p>
<p>Happy 64-bit day <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/04/21/why-you-need-to-ensure-updating-your-xamarin-android-application-to-supports-64-bit-devices-and-how-to-do-that/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">425</post-id>	</item>
		<item>
		<title>Finally a stable version of Xamarin.Forms 4.1.0 and announcing Xamarin.Essentials 1.2</title>
		<link>https://achrafbenalaya.com/2020/04/21/finally-a-stable-version-of-xamarin-forms-4-1-0-and-announcing-xamarin-essentials-1-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=finally-a-stable-version-of-xamarin-forms-4-1-0-and-announcing-xamarin-essentials-1-2</link>
					<comments>https://achrafbenalaya.com/2020/04/21/finally-a-stable-version-of-xamarin-forms-4-1-0-and-announcing-xamarin-essentials-1-2/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Tue, 21 Apr 2020 19:46:28 +0000</pubDate>
				<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=410</guid>

					<description><![CDATA[&#160; Finally a stable version of Xamarin.Forms 4.1.0 and announcing Xamarin.Essentials 1.2 When It comes to Xamarin I say Believe &#38; Trust &#38; Love and I will tell you exactly why ! Back in the days ,when Xamarin was not yet integrated by Microsoft , and Xamarin was paid ,I was a student and I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Finally a stable version of Xamarin.Forms 4.1.0 and announcing Xamarin.Essentials 1.2</p>
<p>When It comes to Xamarin I say Believe &amp; Trust &amp; Love and I will tell you exactly why ! Back in the days ,when Xamarin was not yet integrated by Microsoft , and Xamarin was paid ,I was a student and I had a student license to use it , and with all the struggle at that time , and even when my friends said this platform will not succeed , I believed in and kept working with it, following James Montemagno and the community and I trusted them with their work and updates and here we are now in version 4.1.0 with a lot of enhancement and updates .</p>
<p>I remember last year when I just landed my first job and I was still a Microsoft student partner . I was asked to develop a cross platform app for our company , and I remember one day , when I was asked by our team leader to develop a page that contains checkboxs ,yeah ,back when there was no check boxes in xamarin.forms and that was the time when I started a conversation with my friends and also Msp’s Gassen Ben Hadj, Azzouz Njah and Mariem Kharrat about how I could create or integrate that , in less than two days , and finally , I found a solution and I ended up creating a YouTube video about it, you can find the link here .</p>
<p>Now , why I love Xamarin community ? because they heard about our struggle and now added a check box to this new version and I was so exited so I had to test it .</p>
<div class="jeg_video_container jeg_video_content"><iframe title="Xamarin.Forms 4.1: CheckBox" width="500" height="281" src="https://www.youtube.com/embed/dBqvNK_LuCo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<p>&nbsp;</p>
<p>This week marked the launch of Xamarin.Essentials 1.2 too, packed full of new enhancements and optimizations. The main highlight is the new file preview features enabling you to send, view, and email files from a single cross-platform API .</p>
<p>One more thing , if you have doubts about creating beautiful UI using xamarin froms , you may want to check this GitHub repo</p>
<p>You can read more about this here .</p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/04/21/finally-a-stable-version-of-xamarin-forms-4-1-0-and-announcing-xamarin-essentials-1-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">410</post-id>	</item>
	</channel>
</rss>
