Posts

Showing posts with the label issue

Parse for Xamarin Forms - No PCL, my solution with conditional builds

Image
About Parse In my previous article (or next, we will see ;) I talk about Parse BaaS. This is a 'Back end As Services' that offers you simple but really convenient back end capabilities for storage but also managing users... I approach why I choose this technology for my mobile application, looking for advantages and drawbacks. Parse, after being purchased by Facebook, was closed last year, but fortunately, the source code is open source and Parse still exists . So you can install your own server or use the new Parse on Buddy platform for instance. You can take a look here:  https://buddy.com/parse/ The problem with Parse for Xamarin Forms So, actually the problem is that we can find .NET Xamarin SDK but specifically for iOS and Android frameworks. There is no SDK for Xamarin Forms. The ideal solution could be the following: Many 'pseudo' solutions can be found on internet but I will give you mine, using conditional builds in Visual Studio. I

[Xamarin Forms] XAML previewer in Visual Studio 2017 (really slow)

Image
Preview my Xamarin Forms XAML ? Today, I started a new Xamarin Forms application and for that I decided to use Visual Studio 2017 Community edition. Why ? Because I know that this version includes interesting features to me. One of this feature is that we can preview our Xamarin Forms XAML pages (theorically in a better way than in VS2015). First, we have to notice that to preview XF XAML pages, we don't use the exact same way as with  traditional XAML pages. In fact what we are looking for is not the designer but the Xamarin Forms Previewer Window . Take a look at the next steps to understand the differences...  There is not a lot of details on Xamarin Web site: https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-previewer/ XAML Designer vs Xamarin Forms Previewer On a XF XAML page, right click on the code: Using traditional "Designer menu" as for traditional XAML page We got an error Then use the previewer ( menu VIEW\Other Wi

VS2013 Xamarin's incompatible plugin when installing VS2015...

Image
As a good .NET developer, yesterday I installed the new Visual Studio 2015 IDE to discover all its new features... VS2015 installed ! I was previously developping mobile apps with Xamarin on VS2013. So as I am impatient I installed VS2015 without thinking of all the modifications it can bring to my environment... And bingo ! When I started back VS2013 to edit my Xamarin's projects, I had a bad surprise: iOS & Android projects no more compatible... But, fortunately, I find a really quick solution to restore Xamarin compatibility with VS2013. In fact in the windows programs / functionnalities menu, I  changed the Xamarin app components configuration like above: Xamarin, change installation Xamarin for Visual Studio 2013 is disabled ! Re-enable it and it s all good :) And go you can continue to develop Xamarin projects with VS2013 !

[Xamarin Forms] Button text alignment issue in Android

Image
Recently, I had to deal with custom Buttons in my Android application. So I designed custom renderers to render it. Unfortunately, I encountered a strange behavior with the text alignment of my buttons. This happens when the button changes of state : - Originally the button's text is centered - When you click it, the text moves to the left See images below:   Before / after the button click After investigating, I found a solution to my problem. In my Android custom button renderer, I had to overwrite a specific method:  ChildDrawableStateChanged public class ExtButtonRenderer : ViewRenderer<Extbutton, global::android.widget.button> { ... public override void ChildDrawableStateChanged(Android.Views.View child) { base.ChildDrawableStateChanged(child); if (Control != null) Control.Text = Control.Text; } ... } That's all ! Related links: Custom renderers: http://developer.xamarin.com/guides

Xamarin.Forms: Picker control and "Items" binding problem...

Image
If I tell you "ComboBox", you will see quickly of which control I'm talking about. There no control named "ComboBox" in Xamarin.Forms but if you search a little, you will find the "Picker " control. Class: Xamarin.Forms.Picker In the namespace: Xamarin.Forms Doc link : http://iosapi.xamarin.com/index.aspx?link=T%3AXamarin.Forms.Picker The problem is that you cannot bind directly "Picker.Items" property in the XAML file ! For that you have to use the code behind file. xaml (doesn't work): <Picker Items="{Binding MyViewModelList}"... /> So what do we have to do ? 1- Name your "Picker" control in the xaml file (by adding an attribute like x:Name="uiPicker" ) 2- On the parent page in code behind, override the "OnBindingContextChanged( )" method 3- In this method, fill your "Picker.Items" property from your viewmodel's values. 4- On the XAML file, you can onl