Loic.XLabs.Xamarin-Forms-Labs 1.0.0

dotnet add package Loic.XLabs.Xamarin-Forms-Labs --version 1.0.0
                    
NuGet\Install-Package Loic.XLabs.Xamarin-Forms-Labs -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Loic.XLabs.Xamarin-Forms-Labs" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.XLabs.Xamarin-Forms-Labs" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.XLabs.Xamarin-Forms-Labs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Loic.XLabs.Xamarin-Forms-Labs --version 1.0.0
                    
#r "nuget: Loic.XLabs.Xamarin-Forms-Labs, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Loic.XLabs.Xamarin-Forms-Labs@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Loic.XLabs.Xamarin-Forms-Labs&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Loic.XLabs.Xamarin-Forms-Labs&version=1.0.0
                    
Install as a Cake Tool

Xamarin Forms Labs Build status

Build status

XLabs is a open source project that aims to provide a powerful and cross platform set of services and controls tailored to work with Xamarin and Xamarin Forms.

##NOTICE: This project is no longer maintained. It may not work with newer versions of Xamarin.Forms.

Call for action for all Xamarin Developers, embrace this project and share your controls and services with the community, add your own control to the toolkit.

Important for developers The master branch is the current development branch. The v.2.0 is the stable branch.

Find a Bug or Fix a Bug [Issue Tracker] (https://github.com/XLabs/Xamarin-Forms-Labs/issues)

Available controls

Available services

  • Accelerometer
  • Cache
  • Camera (Picture and Video picker, Take Picture, Take Video)
  • Device (battery info, device info, sensors, accelerometers)
  • Display
  • Geolocator
  • Phone Service (cellular network info, make phonecalls)
  • SoundService
  • Text To Speech
  • Secure Storage
  • Settings

Available Mvvm helpers (Beta)

  • ViewModel (navigation, isbusy)
  • ViewFactory
  • IOC
  • IXFormsApp (application events)

Available Plugins

  • Serialization (ServiceStackV3, ProtoBuf, JSON.Net)
  • Caching (SQLLiteSimpleCache)
  • Dependency Injection containers (TinyIOC, Autofac, NInject, SimpleInjector, Unity)
  • Web (RestClient)
  • Charting (Line, Bar & Pie) (Alpha)

HOW-TO

We are working in a great wiki on how to use the controls and services.

https://github.com/XLabs/Xamarin-Forms-Labs/wiki

Good forum post helping you setup and use XLabs

Using the MVVM Helpers

ViewFactory Coming soon

Using the controls

Add XLabs.Forms reference to your projects , main pcl, ios, android, and wp.

Xaml :

Reference the assembly namespace

 xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"

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 = ImageOrientation.ImageToLeft,
            Source = "icon_twitter.png",
            Text = "Twitter"
        };
stacker.Children.Add (button);

Using the Services

TextToSpeechService

Resolver.Resolve<ITextToSpeechService>().Speak(TextToSpeak);

Device

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

PhoneService

    var device = Resolver.Resolve<IDevice>();
    // not all devices have phone service, f.e. iPod and Android tablets
    // so we need to check if phone service is available
    if (device.PhoneService != null)
    {
        device.PhoneService.DialNumber("+1 (855) 926-2746");
    }

Initializing the Services

Do this before using the services

Step 1:

  • iOS ⇒ Make sure your AppDelegate inherits from XFormsApplicationDelegate

  • Android ⇒ MainActivity inherits from XFormsApplicationDroid

  • Windows Phone ⇒ Add this line to your App.cs var app = new XFormsAppWP(); app.Init(this);

Step 2: Initialize the container in your app startup code.

    var container = new SimpleContainer ();
    container.Register<IDevice> (t => AppleDevice.CurrentDevice);
    container.Register<IDisplay> (t => t.Resolve<IDevice> ().Display);
    container.Register<INetwork>(t=> t.Resolve<IDevice>().Network);

    Resolver.SetResolver (container.GetResolver ());

For more info on initialization go to the Labs Wiki


Build the project

To develop on this project, just clone the project to your computer, package restore is enable so build the solution first, if you get any errors try to build each project independently .


Nuget

Main Packages:

Plugins:

  • To be updated...

Contributions:

Other Project Contributions:

  • Xamarin.Mobile

Contribute

Everbody is welcome to contribute with any kind of controls or features at this time.

Twitter hashtag : #xflabs


CHAT

XLabs Chat room online on Jabbr


License

License Apache 2.0 more about that in the LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/31/2021