Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Contribute to the Xamarin Forms Toolkit



  • rmarinhormarinho PTMember, Insider, Beta Xamurai
    edited June 2014

    That would be great, we can use that to make a win8 grid view alike that i was trying for ages ..

    I have added you to the contributors @msmith you can just add it , or if you can you can submit a PR.

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭
    edited June 2014

    @KevinFord today i tried to do that screen.... i published a code for WP8.0 ( if it helps, not sure... In that screen it should be possible to add user/pass for a custom auth

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    @saramgsilva‌ i think you are a little confuse, that screen has nothing to do with authentication. It's @KevinFord‌ showing it's implementation of the ImageButton on Android that he is contributing to the Xforms Toolkit.

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭

    @rmarinho oh really? But the user interface is like the auth page :D but is a cool feature to have a page for auth

  • KevinFordKevinFord USUniversity, Certified XTC Partners ✭✭✭

    Yes, the page is just a sample page and doesn't do any real authentication. If you do want to do authentication to those four providers I suggest you look at Azure Mobile Services. It works with all those providers and creates a simple, unified and easy to use interface for getting at them. That's what my actual implementation of that screen uses.

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭

    @kevinford i know that solution with Azure Mobile Services, that is very nice!! But for it i need to use and i want a solution for auth without Azure Mobile Services.

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭

    @kevinford i know that solution with Azure Mobile Services, that is very nice!! But for it i need to use and i want a solution for auth without Azure Mobile Services.

  • KevinFordKevinFord USUniversity, Certified XTC Partners ✭✭✭

    Ah that's too bad. You can always go to the API's published by Facebook, MS, Google and Twitter. They are all different so you will need four different implementations and need to maintain them as they change.

    Out of curiosity why not Azure Mobile Services. For a low use app you will be unlikely to surpass the "free" threshold. If you have enough usage where you will have to pay for Azure Mobile presumably you have some way to monetize your app and that's not a problem either... :)

  • SKallSKall USMember ✭✭✭✭

    I am playing around porting my existing hybrid web view to Xamarin Forms. This would allow one to run hybrid web controls similar to PhoneGap on Xamarin.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    SKall, we have Webview control, what functionality will your web view bring to the table?! Interop between web view and code behind ?

  • SKallSKall USMember ✭✭✭✭

    Yes, it is a bridge between JS and C#. Same interface for iOS, Android & WP8. There is a small demo on how to control CanvasJS chart from native controls:

  • rmarinhormarinho PTMember, Insider, Beta Xamurai
    edited June 2014

    Just to give and update on current state of the XForms Toolkit , incredible work by the community we have 71 commits and 15 forks.
    Latest additions are services to get device information and access phone features like dialing a number, hybridwebview and simple IOC by @SKall‌ , and the MvvmHelpers ViewFactory, with this you can register a view and respective view model , and then it automagicly creates your view and binds to the underlying view model, contributed by @JasonASmith‌ . I added also a AutoCompleteControl in xaml that allows you to bind a collection of suggestions to text entry (doesn't work on android yet).

    Available controls

    • Calendar Control (beta)
    • ExtendedTabbedPage
    • ImageButton (beta)
    • ExtendedLabel (alpha)
    • AutoComplete (doesn't work on android)
    • HybridWebView

    Available services (Beta)

    • TextToSpeech
    • Device (battery info, device info)
    • Phone Service (cellular network info, make phonecalls)

    Available Mvvm helpers (Beta)

    • ViewModelBase
    • RelayCommand ; RelayCommand< T >
    • ViewFactory

    Using the controls

    Add XForms.Toolkit.Controls reference to your projects , main pcl, ios, android, and wp.

    Xaml :

    Reference the assembly namespace


    Render your control:

     <controls:ImageButton Text="Twitter" BackgroundColor="#01abdf" TextColor="#ffffff" HeightRequest="75" WidthRequest="175" Image="icon_twitter" Orientation="ImageToLeft"  ImageHeightRequest="50" ImageWidthRequest="50" />

    Or from your codebehind:

    var button = new ImageButton() {
                ImageHeightRequest = 50,
                ImageWidthRequest = 50,
                Orientation= Orientation.ImageToLeft",
                Image = "icon_twitter"
    stacker.Children.Add (button);

    Using the Services




         var device = Resolver.Resolve<IDevice>();
         device.Display; //display information
         device.Battery; //battery information


         var device = Resolver.Resolve<IDevice>();
         device.PhoneService.DialNumber("+1 (855) 926-2746")
  • SKallSKall USMember ✭✭✭✭
    edited June 2014

    Just a quick note on the IDevice interface and their implementations. One of the reasons of creating a IDevice "container" which then exposes interfaces like IPhoneService is to help in determining at runtime if a feature is available. For example if an Android device TelephonyManager.PhoneType is PhoneType.None the phone service is null and it is easy to detect at runtime. Same will apply to sensors once I get a chance to integrate them into the devices.

    As for the hybrid webview I still need to refactor some of the code to integrate the code into Xamarin Forms. I believe the WP8 version works but I haven't had a chance to test it yet. If someone is interested in creating PhoneGap compatible interface for it we could provide easy integration for projects migrating from hybrid web apps to Xamarin.

    We probably need to add device independent pixel of some sort as the Xamarin.Form layouts tend to be very different sizes on each platform, especially on WP8.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    We have added the Geolocator ported from Xamarin.Mobile , check it out to use geolocation in your applications here.
    Working in the 3 platforms now.

  • nodoidnodoid GBMember, Beta ✭✭✭


    trying to build from source and all I'm getting is this...

    Pauls-iMac:XForms-Toolkit-master PFJ$ ./
    XBuild Engine Version 12.0
    Mono, Version
    Copyright (C) 2005-2013 Various Mono authors

    Build started 14/06/2014 22:58:16.

    build.proj: error : /Users/PFJ/Downloads/XForms-Toolkit-master/build.proj: Method 'Combine(/Users/PFJ/Downloads/XForms-Toolkit-master, src, XForms.Toolkit, XForms.Toolkit, packages.config)' arguments cannot be evaluated'
    Build FAILED.

    build.proj: error : /Users/PFJ/Downloads/XForms-Toolkit-master/build.proj: Method 'Combine(/Users/PFJ/Downloads/XForms-Toolkit-master, src, XForms.Toolkit, XForms.Toolkit, packages.config)' arguments cannot be evaluated'

     0 Warning(s)
     1 Error(s)

    Time Elapsed 00:00:00.0964320

    Any ideas?

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Ouch.... sorry the shell script isn't working at the moment, so your project doesn't open because it doesn't find the nuget? and you are on a mac with xamarin studio?!

  • nodoidnodoid GBMember, Beta ✭✭✭

    Yeah, on a Mac.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    don't have very good news to you , simple way is maybe try add this packages directory

    the bad way, is editing the csproject for each project.

    if you find a better way let me know i still don't know how we can do this work.
    In windows the build script works great to bring the packages.

    Nuget restore should work , but i found out it doesn't work as expected on Xamarin.Studio, but i m honest i didn't lost a lot of time looking why it wasn't working

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Some other updates, XForms also has a simple DI container , as well as plugins for working with NInject, SimpleInjector, Tinyioc and Autofac if you need something else.

    We need some help getting up to date with cleaning up the code and releasing public nuget so developers can work with XForms toolkit without the hassle of getting the source code.

  • nodoidnodoid GBMember, Beta ✭✭✭

    Looks like I'll need to edit each csproj file - adding the projects didn't really help. Dammit....

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Grr damit... What files is it complaining in the output?

    Did u pasted the packages folder at the Solution level?

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Just an updated, we are getting ready to have a beta version and available nugets.

    The main features that were added are the Geolocation, and Camera support for all platforms, you can take a picture, or selected from the library.
    There's also a new sample for a simple CacheService implemented using SQLite for all platforms.

    We still need to perform more tests to the toolkit, so feel free to take a look around and submit bugs.

  • JoelFjordnJoelFjordn SEMember

    How can I contribute, e.g. extending the ViewModel base class a bit and also puttng in a NotifyPropertyChangedBase class in the chain?

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭

    Do a fork from

    and then do a pull request.

  • JasonMaddenJasonMadden USMember ✭✭

    Is there a chance anyone could post a .pkg for the sample project for the Android version of the xamarin.forms.labs project. I'm trying to test out the AutoComplete widget before I spend any development time implementing it, but the demo doesn't work.

    I did the latest pull from github

  • rmarinhormarinho PTMember, Insider, Beta Xamurai
    edited August 2014

    try the latest source code from github please

  • NamHoang.3859NamHoang.3859 CAMember ✭✭

    The work in XF Labs is awesome. However, do you still have Nuget packages for iOS and Android? It seems they are unlisted

    Therefore, is cloning the project from Github ( the best way to use XF Labs?

    Thank you.

  • smsilvasmsilva PTInsider, University, Developer Group Leader ✭✭


    you should install this package

    that contains that you want. You don´t need to clone the project for use it.

  • AndyM.0953AndyM.0953 USMember ✭✭

    How can I package up the latest version of master to use in my project? The implementation of HybridWebView in version 2.0 is the only one that works well enough for my team.

  • SKallSKall USMember ✭✭✭✭

    @AndyM.7096 there would be a few ways to do this and it depends how much you want to dig into the source code. If you just want the latest XLabs then fetch the source and build in Release mode and copy the release assemblies to your dependencies folder. You can also work against the source by referencing the individual projects in the source folder. The latter is more work initially to setup but gives you the benefit of being able to dig into the source in case something doesn't seem right.

    That being said we should have 2.0 release in NuGet fairly soon.

  • HenrikStrmbergHenrikStrmberg USMember ✭✭

    What happened to 2.0 release in NuGet fairly soon ?

  • HenrikStrmbergHenrikStrmberg USMember ✭✭

    My misstake I missed the renaming of the nuget package :-)
    Thanks !

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    @All readers of this thread:

    I have implemented XLabs and thereby created a documentation (.pdf).
    You will find it here:

  • BruceFransonBruceFranson USMember
    edited April 2015

    @FredyWenger - thanks!

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭


    It seems, as the link was broken... therefore a new link:

  • I am using Hybridwebview for a hybrid application but I have a problem regarding caching of css / javascript files. I am loading a local html page with the following code:

    String BaseUrl = String.Format("file://{0}/Application", FileSystem.Current.LocalStorage.Path);

    var Source = new UrlWebViewSource
    Url = String.Format("{0}/{1}", BaseUrl, "_index.html")

    HybridWebView webView = new HybridWebView();
    webView.Uri = new Uri(Source.Url);

    The html page includes references to local css files that can be modified by the user at runtime. My problem has to do with the fact that the changes of the related css files are not reflected to the control since it uses cached files. Is there any way to reload all files of the html page? Although, I have found a workaround using jquery I just wish to know if i could tell the control to reload all related content from local files.

  • chaowangchaowang USMember

    It seems the source code need to be updated, dependency nuget packages was out of date.

  • BrianPealBrianPeal USMember

    Feature Request:

    Could someone please add a string field to the ExtendedLabel called "Tag" or something. Why do we need this?

    If a user changes the screen rotation landscape, I like to go through the list of labels and place them right aligned to the left of the text box. If the rotation is to portrait, I set the label on top of the text box and left align. Currently we can iterate through the collection of controls and for each one that is a type of Label, make the change; however, what if we have a particular label we don't want to move? For example, some form instructions.

    A better solution would be to have a new string field added to the Label control which the developer can set the Tag value to whatever they want. Then when we iterate through the control collection we just look for our tag.

    Thanks to who ever can add this feature to the label, or all controls for that matter.

    Scott Peal
    Fortune Cookie Software, LLC

  • KyleMastersKyleMasters USMember ✭✭

    @BrianPeal A potential work around, if they don't get around to this, would be using the x:Name attribute. In the below sample from my code, I set attributes based on the platform, so I have a loginButtonAndroid, loginButtonWinPhone, and loginButtonIOS:

    <Button x:Name="loginButtonAndroid" Text="Login"/>

    You can then manipulate it through the page code, setting whatever attributes are appropriate, i.e.:

    var button = Content.FindByName<Button>("loginButton" + platformName);
Sign In or Register to comment.