Posts

[Xamarin Forms] Custom bottom bordered entry (iOS & Android)

Image
Custom entry with renderers For my Xamarin Forms project I needed to render an 'Entry' control with a bottom border of a specific color. There are several possibilities but I will show you mine. For that, I used renderers. iOS one is particularly not trivial. The wished result look like that: iOS Renderer [assembly: ExportRenderer(typeof(ExtDatePicker), typeof(ExtDatePickerRenderer))] namespace MyCompany.iOS.Renderers { public class ExtDatePickerRenderer : DatePickerRenderer { protected override void OnElementChanged(ElementChangedEventArgs<DatePicker> e) { base.OnElementChanged(e); // Need to connect to Sizechanged event because first render time, Entry has no size (-1). if (e.NewElement != null) e.NewElement.SizeChanged += (obj, args) => { var xamEl = obj as DatePicker; if (xamEl == null) ret

[Xamarin Forms] build error: Unable to cast object of type 'Xamarin.Forms.Xaml.ElementNode' to type 'Xamarin.Forms.Xaml.ValueNode'

Image
Xaml build error For one of my Xamarin project, I just had this build error: This error was related to my XAML code : Unable to cast object of type 'Xamarin.Forms.Xaml.ElementNode' to type 'Xamarin.Forms.Xaml.ValueNode' After searching for a long 'moment', I just didn't understand what happened... My investigation (this process can help you :p) So I decided to remove a large part of my xaml code and then re-add it little by little. Each step I tried to compile to see when error occurs. So In my case, I determined that the piece of code that was going wrong was the following: Ok, it was my mistake but in the code editor, Visual Studio didn't tell me anything. I was trying to bind an event ( I though it was a property ) to a DateTime property... What is not possible. Hope this helps someone to save a few minutes :)

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

[Fast&Furious guide] VS 2017, how to change IDE's language

Image
Visual Studio is now available to download. In my case, I used the english web installer to install the english version. But I was a little bit surprised (or not) to see that the installed version was setup with the same language as my operating system. So here is the simple steps to change the IDE's language: 1- Run Visual Studio 2017 installer (in administrator mode) then click"update" button of the instance you want to update: 2- Then click on the language modules tab 3- Then check all languages you want to use in your IDE 4- Restart Visual Studio then go to Menu / TOOLS / Options / (Environnement - International Settings) menu 5- Finally choose your prefered language in the languages combobox. Note that you can choose 'Same as Microsoft Windows' option. Restart and enjoy programming !

[Spoon] Android testing tool

Image
Did you heard about Spoon ? If you are a mobile developer (in our case an Android developer with hundreds of available target devices), and you know how much testing your app is important, take a look at Spoon ! This tool will enable you to test your app simultaneously - on several android devices, - to take different steps screenshots during your tests, - to display the results in a meaningful way - to compare screenshots from the several devices... Spoon is available on Github: https://github.com/square/spoon All you need to start is here: http://square.github.io/spoon/ Just take a look below or click on the link below to display a Spoon output sample: http://square.github.io/spoon/sample/index.html

[News] Microsoft acquire Xamarin !

Image
In its original blog post ( that you can find it here ), Scott Guthrie has announced that Microsoft acquired Xamarin, the company that gave us the technology to develop mobile apps in C# for  iOS, Android and WP :) Wednesday, February 24, 2016 In my mind it s a good news for the futur evolution of the technology, however we can ask ourself about the futur development and pricing strategies... Hope it will be more accessible, at less in term of pricing, than the actual version ! What do you think ?

[Fast selection] Templates to create a 'pro magazine looking' blog

Image
Today I wanted to create a new blog about new technology articles. So I was looking for good looking templates because I'm too lazy to create my own :) I Googled some hours to find the good ONEs ! My key points were:  - a clear design  - with spaced elements  - elegant or magazine looking styles  - no flashy colors So I propose you my selection; about 10 themes that I like and can be used in a lot of situations; maybe it could be helpfull for you ! Template 1: Olsen http://www.cssigniter.com/ignite/themes/olsen/ Olsen: from 39$ Template 2: Revive Pro http://revivepro.frogsthemes.com/ (from  http://www.frogsthemes.com/product-category/business-wordpress-themes = About 49$ Template 3: Chameleon Pro http://www.frogsthemes.com/theme-switcher#chameleonpro Chameleon Pro - About 49$ Template 4: Branded Pro http://brandedpro.frogsthemes.com/blog/ (from  http://www.frogsthemes.com/product-category/business-wordpress-themes ) Branded pro -