Posts

Xamarin.Forms device unique ID...

As in a lot of applications, you will probably need to get a unique identifier to identify a unique user . And it becomes a little more complicated when you have to deal with different platforms like Android, iOS and Windows Phone... Here is a simple solution that you can implement in Xamarin Forms that I found on this blog: http://codeworks.it/blog/?p=260 First define a service that you will use in your Xamarin Forms Application: // Your service interface definition public interface IDevice { string GetIdentifier(); } // How you get your service in your app IDevice device = DependencyService.Get (); string deviceIdentifier = device.GetIdentifier(); And here are the implementations for Android / Windows Phone and the most complicated, iOS platform: // WINDOWS PHONE [assembly: Xamarin.Forms.Dependency(typeof(WinPhoneDevice))] namespace XFUniqueIdentifier.WinPhone { public class WinPhoneDevice : IDevice { public string GetIdentifier() { byte[] myDeviceId = (

Xamarin & Caliburn.Micro

Good news for Caliburn.Micro users: it is now ( almost ) compatible with xamarin! http://caliburnmicro.com/announcements/xamarin/

Unit Testing and Memory Profiling

You know Unit tests, you use it & it's good. Sometimes, you want to ensure that you don't have memory leaks. Here is a way of doing this. Jetbrains offers us a new soft to combine UT & Memory profiling. If you want to know more, you could have a look in here : http://blog.jetbrains.com/dotnet/2015/03/04/unit-testing-and-memory-profiling-can-they-be-combined/ . Happy coding!

Hey bloggers, insert code snippets in your posts !

You wonder how to to add nice code snippets in your blog posts ? I have configured this blog to insert snippets (following this article): http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html The good tool used is SyntaxHighlighter : http://alexgorbatchev.com/SyntaxHighlighter/ All you have to do now is to insert your code in your post using the following <pre> TAG (in HTML mode): // Comment <pre class="brush: csharp">// Comment public class Testing { public Testing() { } public void Method() { /* Another Comment on multiple lines */ int x = 9; } } </pre> Note that if your code contains '<' or '>' characters, you will need to encode it into HTML format, using a tool like this one: http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx Enjoy and write new posts !

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

Mvvm From A to Z

For french developpers, you can have a look at my MVVM My Way article . It proposes an end to end solution to developp an MVVM application. This article covers the global architecture, the associated tools & the way of testing the app.

[Code de porc]

Image
Code I have seen somewhere (in production code) :) Interesting...

Syncfusion free eBooks !

Don't wait anymore! Here is a list of kick starters books covering various subjects (Xamarin, Machine Learning, R, AngularJS...): https://www.syncfusion.com/resources/techportal/ebooks Don't hesitate to dowload, it is free!