Entradas

MultiSelect Listview Xamarin.Forms

Imagen
Hello! In this post we gonna see how to implement a MultiSelect Listview using Xamarin Forms. First we need to create a custom ViewModel, in order of handle the items selected After that we create add to our page the listview and another elements that help us to show the differents items in the ListView. Now we add a ViewModel to handle the calls to UI The result in iOS is the Next one: The result in Android is the Next one: Here is the url for the complete code on Github: https://github.com/osvaldosantiago/MultiSelectListViewXF Follow me on Twitter https://twitter.com/OsvaldoSan Or find me in Linkedin https://mx.linkedin.com/in/osvaldo-santiago-estrada-15480741

Xamarin.Forms Listview inside of ScrollView

Hello, in this post i will put a ListView inside, I know that do this is not recomendable, but if for someone requeriment you need to do that, this is one way of do that: "You shouldn't put a  ListView  inside a  ScrollView  because the  ListView  class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent  ScrollView ." Looking in the web, I found that one solution is using  MotionEvent in order of detect wich event is happening. To do that we need to make a render of the Xamarin.Forms.ScrollView. in iOS do a custom render is not necessary, because it does automatically, we can look that on iOS: iOS implementation But, for Android, is necessary create the custom render, in order of do that, we add a new class for the implementation of this render, it would be like any other renderer, but in this one, we need override, the  DispatchTouchEvent, to detect what kind of  MotionEventActions

Underline Label in Xamarin.Forms

Imagen
Hello everyone, in this post i will create a custom render in order of have a UnderlineLabel, First of all else, we need to create our class which hierarchy from Xamarin.Forms.Label: using  System ; using  Xamarin . Forms ; namespace  UnderlineLabelXF {      public   class   UnderlineLabel : Label      {          public  UnderlineLabel ()          {          }      } } After that, we need to create the renderer in each platform, first we create in iOS: We create a folder with the name Renderer, inside of it, we add a class in order of make the renderer: using  Foundation ; using  UIKit ; using  UnderlineLabelXF ; using  UnderlineLabelXF . iOS ; using  Xamarin . Forms ; using  Xamarin . Forms . Platform . iOS ; [ assembly :   ExportRenderer ( typeof ( UnderlineLabel ) ,   typeof ( UnderlineRenderer ))] namespace  UnderlineLabelXF . iOS {      public   class   UnderlineRenderer : LabelRenderer      {          protected   override   void   OnEle

Entry Show/Hide Password on Xamarin.Forms

Imagen
Hello, in this post i will talk about a way of how to implement a Show/Hide password on Entry control. In our Xamarin.Forms project, we add  a CustomRender for iOS, and  for Android we are using a Effects in order of have a result almost equals. I'm gonna start with the iOS functionality, so I will add a class render: using System ; using Xamarin.Forms ; namespace ShowHidePasswordEntryXF { public class ShowHidePasswordEntry : Entry { public ShowHidePasswordEntry () { } public string EntryText { get ; set ; } } } After that, in the iOS project, i will create the renderer, in which I add a UIButton and add a EventHandler in order to know if the user want to look the password or not: buttonRect . TouchUpInside   +=   ( object   sender ,   EventArgs   e1 )   = >                  {                      if   ( Control . SecureTextEntry )                      {                          Control . SecureTextEntry   =   false ;