Version

Creating Project with Infragistics Controls

Purpose

This topic explains how to create application project to use with Infragistics Xamarin.Forms controls.

In this topic

This topic contains the following sections:

Introduction

The following procedure demonstrates creating a project using Infragistics Xamarin.Forms Controls.

Prerequisites

To complete the procedure, you need the following:

Create Projects

  1. Open Visual Studio 2019

  2. From the opening screen, select the Create a new project item.

  3. Select the Mobile App (Xamarin.Forms) project template. Name the project SampleApp and click the Create button.

  4. Choose the structure of the application you would like to create. This topic is built against the Blank application template.

  5. This will create three separate projects:

    • SampleApp — This is a portable class library where you can put your shared logic and layout.

    • SampleApp.Droid — This is where you can put any Android specific logic or layout, and bootstraps Xamarin.Forms onto an Android device.

    • SampleApp.iOS — This is where you can put any iOS specific logic or layout, and bootstraps Xamarin.Forms onto an iOS device.

Add References

You can use Infragistics NuGet package as follows. If you are unfamiliar with NuGet, see the following Nuget Tutorial.

  1. Right click on the solution node.

  2. Select Manage NuGet Packages For Solution menu item.

  3. Click on the Browse tab.

  4. Type "Infragistics" into the search box.

  5. According to the controls used for the solution, the following NuGet packages will install the necessary references:

    NuGet Package Control

    Infragistics.XF.Barcodes

    XamQRCodeBarcode

    Infragistics.XF.Gauges

    XamBulletGraph
    XamLinearGauge
    XamRadialGauge

    Infragistics.XF.DataGrid

    XamDataGrid

    Infragistics.XF.Charts

    XamDataChart
    XamCategoryChart
    XamDoughnutChart
    XamFunnelChart
    XamPieChart
    Legend
    ItemLegend
    ScaleLegend

    Infragistics.XF.Sparkline

    XamSparkline

    Infragistics.XF.Scheduler

    XamScheduler

    Infragistics.Xamarin.Excel

    Workbook
    WorkSheet

    For each necessary NuGet Package:

    1. Select the package in the package browser.

    2. Select all projects.

    3. Select the version of Infragistics NuGet Packages you want to use.

      Note
      Note
      For all Infragistics NuGet Packages within the same solution, the same version must be chosen to install. Choosing to install a different version than the solution currently has will force an install of all Infragistics NuGet packages in the newly selected version.
      Choose Projects and Versions
    4. Click Install.

    5. Click OK to accept changes if a preview changes dialog appears.

    6. These images list Infragistics assemblies that were referenced in projects after adding all Infragistics NuGet packages. You might see subset of these assemblies if you selected only a few NuGet packages for Infragistics components:

      Project References

Add Namespaces

Add the following namespaces to code-behind files in which you are planning to create instances of Infragistics controls:

In XAML:

xmlns:igBarcodes="clr-namespace:Infragistics.XamarinForms.Controls.Barcodes;assembly=Infragistics.XF.Barcodes"
xmlns:igGauges="clr-namespace:Infragistics.XamarinForms.Controls.Gauges;assembly=Infragistics.XF.Gauges"
xmlns:igGrids="clr-namespace:Infragistics.XamarinForms.Controls.Grids;assembly=Infragistics.XF.DataGrid"
xmlns:igCharts="clr-namespace:Infragistics.XamarinForms.Controls.Charts;assembly=Infragistics.XF.Charts"
xmlns:igSpark="clr-namespace:Infragistics.XamarinForms.Controls.Charts;assembly=Infragistics.XF.Sparkline"
xmlns:igScheduler="clr-namespace:Infragistics.XamarinForms.Controls.Scheduler;assembly=Infragistics.XF.Scheduler"

In C#:

using Infragistics.XamarinForms;
using Infragistics.XamarinForms.Controls.Barcodes; // for XamQRCodeBarcode
using Infragistics.XamarinForms.Controls.Gauges; // for XamRadialGauge, XamLinearGauge, XamBulletGraph
using Infragistics.XamarinForms.Controls.Charts; // for XamDataChart, XamCategoryChart, XamFunnelChart, XamPieChart, XamSparkline, XamDoughnutChart
using Infragistics.XamarinForms.Controls.Grids;  // for XamDataGrid
using Infragistics.XamarinForms.Controls.Scheduler; // for XamScheduler

Create Controls

Refer to the Getting Started sections under the following topics in order to create instances of Infragistics controls: