Code Editing Assists

XamRight has numerous options to automatically generate XAML and C# code at your direction. It uses its deep analysis of your program to provide the right options, customized to the right context.

Binding Converters

Binding Converters require writing boilerplate code and making sure the references are correct between your Binding expression, your ResourceDictionary, and your C# implementation. See how XamRight can help:

This demo develops a small app displaying data from SWAPI – The Star Wars API. It shows different ways to simplify adding Binding Converters to your XAML file, including by importing fully-functioning converters as source from GitHub sources. For Xamarin.Forms, this includes:

CrossGeeks/UsefulConvertersSample: Xamarin Forms useful converters list. (github.com)

jamesmontemagno/xamarin.forms-toolkit: Toolkit for Xamarin.Forms (Controls, Behaviors, and Converters) (github.com)

The demo shows also shows how writing TapGestureRecognizers can be done with a lot fewer keystrokes.

Triggers

There are several kinds of triggers that can be added to different nodes in different contexts. Triggers are powerful tools to keep a lot of functionality in XAML rather than in code-behind. See how XamRight makes these easier to write by understanding which Trigger options are applicable where, and inserting the code customized to the context.

View Model Properties

When working in Xaml, you can have XamRight create new view model properties in the C# view model class by entering the property name in the Binding that you want to create. XamRight will warn that it doesn’t exist, and will give you the option to create it:

XamRight can create simple get/set properties, or properties defined appropriate for a number of common MVVM frameworks (Prism and more). If none of those are appropriate for you, select “using Custom Property Template”, as shown above. This allows you to create your own template for view model properties, as shown below:

As shown above, you’ll see a preview of what your view model property will look like with a new string property called Username, and a method called PropertyChanged defined on the view model base class which invokes the INotifyPropertyChanged.PropertyChanged event.

Once you’ve defined a template and given it a name, you can use it whenever you want when you instruct XamRight to create new properties for you.

You can find and edit your templates at Tools > Options > XamRight > Binding Converter Templates.