Category: Xamarin Forms

Infragistics AppMap for Xamarin.Forms

Introduction

Today, Infragistics has made the popular AppMap for Xamarin.Forms available to all developers at no charge.

AppMap enables developers to visually map out and then generate their Xamarin.Forms application.

The code generation includes selected projects (iOS and Android, UWP coming soon), Pages (Views), ViewModels, and navigation code that follows best-practice Prism MVVM architecture.

For example, last month I created a 17 page application in three minutes. Easily saved myself an hour or two with project creation..

Videos

Please watch these short AppMap training videos to ensure you get the most from the AppMap tool and Prism for Xamarin.Forms.

Download and Installation

AppMap is included with the Infragistics Platform Installer and can also be download from the Visual Studio Marketplace.

Additionally, you can install from within Visual Studio using the Extensions and updates dialog.

AppMap works in all versions of Visual Studio 2015 and 2017.

Launching AppMap

AppMap is launched from the Visual Studio New Project Dialog or New Item Dialog.

NewProject

When using the New Item dialog, the name has no impact and is not used by the tool.  You can leave the default name and click the Add button.

Note: The New Item dialog only works with Xamarin.Forms project that were created by AppMap.

NewItem

Sign In

The first time you open AppMap you’ll need to sign in.  If you don’t have an Infragistics account yet, click the link and set one up.

The Customer Experience Improvement Program really does help us plan, allocate resources, is zero impact, and anonymous. As you can imagine, creating and maintaining Visual Studio Tooling is expensive and time consuming. This data helps us provide the best tooling for our customers and provide free tools to the community.

SignIn

Project Selection

This Create New Project dialog allows the developer to select the platforms for project creation. 

UWP will be supported in the coming soon release of AppMap

AppMap uses Prism for Xamarin.Forms. Prism provides a modern framework and developer guidance that embraces separation of concerns, dependency injection (DI), MVVM, and provides an incredibly rich, simple, and easy to use navigation API. The docs can be read here.

This dialog prompts you to select the DI Container you would like to use. When the project is created by AppMap, or when an AppMap Item is added to a project, AppMap automatically registers the added pages with the DI Container for you.

The Show AppMap checkbox allows you to show the AppMap dialog and then create the projects, or when unchecked, just create the projects.

The purpose of this dialog option is to enable a real-world application development workflow. Most developers have their own ViewModel base class.  AppMap allows developers to select the ViewModel base class to use for code generation. You can use one of two provided bases classes, or selected your own. So, by first creating  empty projects (projects without pages), developers can then bring in their own libraries and frameworks to the solution.  Then, launch the add New Item dialog, and in the AppMap select your ViewModel base class.

If your not familiar with the provided AppMap ViewModel base classed, please review them.  They both implement Prism navigation interfaces and have several commands that AppMap expects a ViewModel to have.  When AppMap generates your views, it wires up buttons and toolbar buttons to commands on the ViewModel. Optionally, you can derive your own ViewModel base class from one of the provided ones, but this is not a requirement.

ProjectDialog

AppMap

AppMap provides a diagram tool for laying out pages and creating relationships between them. These relationships provide the tool metadata for generating navigation code.

A feature of AppMap is to parse the entered Name, and set the Title property. You can edit the Name by double clicking the name in the diagram page or use the Properties panel.

The Code Generations Options panel is where you decide where your ViewModels will be placed, which folder names you would like to use, and the ViewModel base class to use.

Again, please watch the series of videos on AppMap to get a full understanding of it’s capabilities and features.

AppMap

This is the solution that was created by the above AppMap selections.  It took me 30 seconds to lay my application out and create it.

Notice that I like my ViewModels nested under my views.  This is not a requirement, but a personal preference.

Solution

Road Map

In the near future, we’ll release a new version of AppMap with these features:

  • .NET Standard 2.0 Xamarin.Forms Project Creation
  • Option to create UWP Project

Close

I always use AppMap for creating my projects as it saves so much time and saves me from having to create the pages and ViewModels one by one.

Have a great day,

Just a grain of sand on the worlds beaches.

Enterprise Xamarin.Forms Training

Profissional Xamarin.Forms development has a sizable concept count.

Anyone with a little XAML experience can follow the many getting started tutorials and successfully create a Xamarin.Forms application for iOS, Android, UWP, and soon to RTM macOS.

However, once your application evolves beyond demoware towards a paid for or corporate enterprise application that must be maintainable over time,  the developer and team will need to start addressing the many facets of professional mobile development.

The best place to start is with the Xamarin.Forms documentation.  I always tell folks, “when all else fails, Read The Free Manual. (RTFM).” From here invest in your skill set and attend https://university.xamarin.com.

Personally, I’m looking forward to the next RTM release of Xamarin.Forms and it’s full support for .NET Standard 2.0.  This release will provide for much easier to share code without the confusing and frustrating assembly target profiles.  The number of available API’s will also be greatly enhanced.

I don’t like reinventing the wheel, especially on platforms that are not my primary development platform.  Instead, I like to leverage the knowledge and experience of professionals that their day-to-day focus is the platform I’m learning.

I just found an outstanding resource for Profissional Enterprise Xamarin.Forms Development by MVP Adam Pedley here:

https://training.xamarinhelp.com/course/enterprise-xamarin-forms-development/

Adam’s blog is located here:  http://xamarinhelp.com/

Adam’s training site is new and the content is ever growing. I just completed this course and learned a lot on these topics:

  • Architecture
  • Cross-cutting concerns
  • Security
  • Analytics

Xamarin.Forms Development Tooling

  • Cross-platform Environment Setup
  • Debugging
  • Application Profiling
  • Unit Testing
  • UI Testing
  • Continuous Integration and Deployment

This course will expose you to the high number of considerations and essential topics for creating a Profissional Xamarin.Forms application.

Have a great day,

Just a grain of sand on the worlds beaches.

Ocean Validation for Xamarin Forms

Introduction

This blog post is about an example Xamarin Forms project I wrote to show using Prism, Unity, and Ocean Validation in several scenarios.

I decided to make this a video blog post and have six videos for you.

You learn the following:

  • Using the sample Xamarin Forms app and understanding the line of business scenarios it covers.
  • Using Prism and Unity in a real-world Xamarin Forms App
  • Dependency injection in a real-world Xamarin Forms App
  • Abstracting Static services and Static Device information behind interfaces to promote testing and maintainable code
  • Using Prism NavigationService and PageDialogService
  • Async Await contrasted with the Promise pattern in a Xamarin Forms App
  • Ocean validation framework with Xamarin Forms
  • Using IDataErrorInfo to surface validation errors for properties or the entire object.  (Yes, IDataErrorInfo!)  This also works for UWP.  These two platform’s binding pipeline lack data validation.  No worries, it’s very easy to do now.
  • Using Ocean validation to validate an object in multiple states.  Multiple validation states imply that the object is going through a workflow, where an object can be valid for a certain state, but not valid for other states.  This is a common scenario in complex business applications like insurance claims or when an object is completed over several Xamarin Forms pages.
  • At the end of November 2016, the Xamarin Forms ListView view began to have some problems that cost me over a day.  In the last video, I explain the issues and what I did to get around them.  I also wrote up bugs and communicated with Microsoft about these issues.

Introduction to Ocean for Xamarin Forms

Prism and Dependency Injection in Ocean for Xamarin Forms

Async Await and Promise Pattern in Ocean for Xamarin Forms

Introduction to Ocean Validation Framework for Xamarin Forms

Ocean Multi-Object State Validation for Xamarin Forms

Xamarin Forms ListView Troubles (as of 1 Dec 2016)

Source Code

https://github.com/Oceanware/OceanForXamarinForms

Close

I hope these videos have helped with your understanding of Prism, Unity, and Ocean in Xamarin Forms.

Have a great day,

Just a grain of sand on the world’s beaches

Updated Xamarin Forms BindablePicker

Introduction

On 9/30/2016 I updated the Xamarin Forms Bindable Picker, correcting it to handle the view model clearing the Items ObservableCollection.

When the view model exposes an ObservableCollection as the BindablePickers ItemsSource and the view model clears that collection, the BindablePicker now responds correctly and updates the UI as expected by:

  • Removing all items in its collection
  • Setting SelectedItem to null
  • Setting SelectedValue to null
  • Setting SelectedIndex to -1

Much appreciate the feedback and bug reports I’ve received to make this control much better.

Close

Have a great day,

Just a grain of sand on the world’s beaches

Xamarin Dev Days Cranbury NJ

Infragistics is hosting Xamarin Dev Days on 19 Nov 2016 at our corporate office in Cranbury, NJ.

The very popular Xamarin Dev Days event sold out in one day, but there is a wait list and you can register here.

In addition to the standard curriculum, there will be an optional Bonus Content session given by Infragistics Engineers that wrote the Infragistics Xamarin Forms product.

Attend the fun day of learning with fellow developers and MVP’s at our excellent facility.

Have a great day,

Just a grain of sand on the world’s beaches

 

 

 

Xamarin Forms Bindable Picker v2

Introduction

I’ve updated the BindablePicker from a previous blog post, added new features and created a github reopro for the code.

Xamarin Forms is a new and cool API for quickly building native apps for IOS, Android, and Windows UWP in C#.

The Xamarin Forms API comes with a primitive Picker control that lacks typical bindable properties that developers expect a Picker (similar functionally that a desktop ComboBox has) to have.

Xamarin Forms makes it very easy for developers to extend the API, write your own custom controls, or write custom renderers for controls.

This BindablePIcker is the result of studying blog and forum posts and receiving feedback and bug report on the original version.

API Comparison

Xamarin Forms Picker API

  • SelectedIndex (bindable)
  • Items (not bindable)

Bindable Picker API

  • ItemsSource (bindable)
  • SelectedItem (bindable)
  • SelectedValue (bindable)
  • DisplayMemberPath
  • SelectedValuePath

New Features Added

  • Support for collections that implement INotityCollectionChanged like the ObservableCollection

Bug Fixed

The original BindablePicker did not correctly set the SelectedItem after the ItemsSource was refreshed at runtime.

Bindable Picker Source

This repro contains a project that demonstrates scenarios for using this control and it has the source for the BindablePicker.

https://github.com/Oceanware/XamarinFormsBindablePicker

Training Video – XAML Power Toys BindablePicker Scenarios

This short video explains three common use cases for the BindablePicker.

Close

Have a great day.

Just a grain of sand on the worlds beaches.