Posts

Hyperlink label in Xamarin.Forms

Many a times we required a hyperlink label in mobile application. For example, you need to show "privacy or Terms and condition" as hyper link and clicking on it should open that link in browser. Unfortunately Xamarin.Forms does not have such in-built control. But it can be achieve using the powerful features called Custom Renderer. I will going to show on how to create a Hyperlink label in this post. This article assumes, that you know about Xamarin.Forms and have a basic understandings of Custom renders. if not familiar with this, i would suggest read through this.  read through this. Lets dive into code now. So first create a class called "HyperlinkLabel" which should be inheriting from Xamarin.Form's "Label" control. public   class   HyperlinkLabel   :   Label {     public  HyperlinkLabel ()     {     } } Label" control. The definition of class is very simple. It inherited from Label control. Droid : Now go to your Android p

Fetching Address book AKA Contact information from Device using Xamarin.Forms

It's  been while I didn't write anything. This time I came with something in Xamarin.Forms. This article is intended to show the powerfulness of Xamarin.Forms and it's component to achieve the result with a common code base. This article demonstrate on how to fetch address book (Contacts) information from a platforms (Android/iOS) using Xamarin.Forms. It works in conjunction with Xamarin.Mobile components. Xamarin.Mobile components is an API for accessing common platform features, such as reading the user's address book and using the camera, across iOS, Android, and Windows Phone. Its truly a fantastic component to achieve the functionality of platform specific features. but sadly, it does not have any support for Xamarin.Forms and thats where this article comes in picture. What I did is,  used Dependency service of Xamarin to get platform specific features in Xamarin.Forms. For more information about Dependency service please visit: http://developer.xamar

Unveiled the features of C#

Hello Fellow developers! This article describes some tricks about popular contest questions. 1. Write a program to print current Source code line number in c#:  public static void Main(string[] args)  {      Console.WriteLine("Hello World, from line {0}!", GetLineNumber());      Console.ReadLine();  } private static int GetLineNumber([CallerLineNumber] int sourceLineNumber = 0) {     return sourceLineNumber; } You need to use System.Runtime.CompilerServices for "CallerLineNumber" attributes which Allows you to obtain the line number in the source file at which the method is called. Simply easy. isn't it? There are other attributes like [CallerMemberName] - which obtains the method name from which it was called, [CallerFilePath]- returns the source file path.  2. Now next puzzle, is a popular equation "2+2 = 5". so how to do it in C#?. It also pretty simple. believe me! public static void Main(string[] args) {         var resul

Snow Garba in Netherlands

Image
Hello Folks, This time I came with some non-technical, funny things to share with you. Garba is a traditional dance of Gujarat - India. People play it on someone's marriage ceremony. It also played on a festival called "Navratri" (nine nights). Navratri is a longest dance festival in the world. It is celebrated nine nights by playing Garba (whole night) . You can find more information on Navratri here . The above video will show you how to play Garba in traditional style. So Enjoy the Garba... Have a nice playing :)

Custom Attributes in MVC

Many a times, in web development world, it is required to access certain page on https while others are on simple http. In ancient time, it can be achieve through configuring URL re-writing concepts in IIS. But if you specifically developing your web application in Asp.net MVC, it is lot easier to implement. Believe me! This article describe on how to develop functionality for accessing certain page on Https protocol while others are on simple http. Scenario: Let us take an example of web site where login page needs to be accessed over secure socket layer (SSL - https) while after loging in, rest of the site should be run on normal http. Assume that this web application is to be developed using asp.net MVC Solution: Many of you may already aware about attributes or custom attribute. Attributes provide a powerful method of associating declarative information with C# code (types, methods, properties, and so forth). Once associated with a program entity, the attribute can be

Partial view and AJAX Form with MVC3 Razor

Image
One of the great advantages of using MVC is the partial view. In real life projects, sooner or later you come across the situations where you need to reuse the already developed thing. For this, in asp.net web forms, Web user control is there. In MVC, It is Partial view.  Partial view can be used as a plug and play user control for reusability. For updating a part of the page, we can use AJAX Form. By using the combination of AJAX form and partial view, we can create ajaxify web application in MVC. It is important to think that where and how you use partial view in your project. The proper structure of folder is also important while designing partial view. In ASP.net MVC application, all views are stored inside the "View" folder. You can keep your partial views in a special folder called "Shared" which is by default provided by the MVC when  you create a new web project of MVC type. B