Autogenerated by MFractor v3.2.17

Generate Bindable Property

Configuration Id: com.mfractor.code_gen.forms.csharp.bindable_property

Generates a Xamarin.Forms bindable property implementation and a proxy property that calls the BindableProperty implementation.

Configurable Properties

Name Type Defaults To Description
Snippet Code Snippet

Arguments:
  • name: The name of the new bindable property.
  • type: The type of the new bindable property.
  • control_type: The control type that the new bindable property has been created inside.
public static readonly Xamarin.Forms.BindableProperty $name$Property = Xamarin.Forms.BindableProperty.Create(nameof($name$), typeof($type$), typeof($control_type$), default($type$));
public bool $name$
{
get
{
return ($type$)GetValue($name$Property);
}

set
{
SetValue($name$Property, value);
}
}
When creating the new bindable property, what is the default code snippet MFractor should use?

Generate ICommand Implementation

Configuration Id: com.mfractor.code_gen.forms.csharp.command_implementation

Generates a boilerplate implementation of ICommand using an inline Xamarin.Forms.Command.

Configurable Properties

Name Type Defaults To Description
Snippet Code Snippet

Arguments:
  • name: The name of the new command.
  • type: The fully qualified type of the new command
public System.Windows.Input.ICommand $name
{
get
{
return new $type$(() =>
{
throw new System.NotImplementedException();
});
}
}
What is the code snippet to use when creating the command stub? If not set, this code generator will default to generating a stub Xamarin.Forms.Command implementation
CommandType System.String Xamarin.Forms.Command The fully qualified type to use as the command implementation. For example, using Xamarin.Forms.Command would cause the new expression to be new Xamarin.Forms.Command

Generate IValueConverter Implementation

Configuration Id: com.mfractor.code_gen.forms.csharp.value_converter

Generates an implementation of a value converter.

Configurable Properties

Name Type Defaults To Description
CreateMissingValueConversionAttribute Boolean True If an implementation of the ValueConversionAttribute class cannot be resolved within the project compilation, should MFractor automatically create the implementation?
Namespace System.String null The namespace to place new value converters inside. When empty, new value converters will be placed under the projects default namespace. Place a single '.' before the namespace name to make it relative to the projects default namespace.
Folder System.String null The folder to place new value converters inside. When empty, new value converters will be placed inside the proejcts root folder.
Snippet Code Snippet

Arguments:
  • name: The name of the new value converter.
  • namespace: The namespace the new converter will be placed inside.
  • value_conversion_attribute: The fully qualified type of the value conversion attribute (if available).
  • input_type: The fully qualified type that the value converter should accept as it's input type. If unavailable, defaults to System.Object.
  • output_type: The fully qualified type that the value converter should accept as it's output type. If unavailable, defaults to System.Object.
  • parameter_type: The fully qualified type that the value converter should accept as it's parameter type. If unavailable, defaults to System.Object.
using System;
using System.Globalization;
using Xamarin.Forms;

namespace $namespace$
{
[$value_conversion_attribute$(typeof($input_type$), typeof($output_type$))]
public class $name$ : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
What is the code snippet to use when generating the value converter class file?

Uses:

Generate Platform Specific Effect

Configuration Id: com.mfractor.code_gen.forms.csharp.platform_effect

Generates a new effect, creating the effect inside the common project as well as linked Android and iOS projects.

Configurable Properties

Name Type Defaults To Description
iOSEffectsFolder System.String Effects What is the folder that iOS platform-specific effects should be placed into?
AndroidEffectsFolder System.String Effects What is the folder that Android platform-specific effects should be placed into?
EffectsFolder System.String Effects What is the folder that the effects declaration be placed into?
ResolutionGroupName System.String Effects What is the name of the resolution group?
iOSEffectSnippet Code Snippet

Arguments:
  • name: The name of the new effect.
  • group_name: The resolution group name of the new effect.
  • namespace: The iOS projects default namespace.
  • platform: If you wish to shared the platform-specific effect template, this is the name of the effects platform.
using $namespace$.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.$platform$;

[assembly: ResolutionGroupName("$group_name$")]
[assembly: ExportEffect(typeof($name$), "$name$")]
namespace $namespace$.Effects
{
public class $name$ : PlatformEffect
{
protected override void OnAttached()
{
// TODO: Apply your effect.
}

protected override void OnDetached()
{
// TODO: Remove your effect.
}
}
}
What is the code snippet for the iOS platform-specific effect?
AndroidEffectSnippet Code Snippet

Arguments:
  • name: The name of the new effect.
  • group_name: The resolution group name of the new effect.
  • namespace: The Android projects default namespace.
  • platform: If you wish to shared the platform-specific effect template, this is the name of the effects platform.
using $namespace$.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.$platform$;

[assembly: ResolutionGroupName("$group_name$")]
[assembly: ExportEffect(typeof($name$), "$name$")]
namespace $namespace$.Effects
{
public class $name$ : PlatformEffect
{
protected override void OnAttached()
{
// TODO: Apply your effect.
}

protected override void OnDetached()
{
// TODO: Remove your effect.
}
}
}
What is the code snippet for the Android platform-specific effect?
EffectSnippet Code Snippet

Arguments:
  • name: The name of the new effect.
  • group_name: The resolution group name of the new effect.
  • namespace: The common projects default namespace.
using System;
using Xamarin.Forms;

namespace $namespace$.Effects
{
public class $name$ : RoutingEffect
{
public $name$() : base("$group_name$.$name$")
{
}
}
}
What is the code snippet for the effect?

Generate Value Conversion Attribute

Configuration Id: com.mfractor.code_gen.forms.csharp.value_conversion_attribute

Generates an implementation of the ValueConversionAttribute; the attribute used to hint type-flow in a value converter for design time tools like MFractor.

Configurable Properties

Name Type Defaults To Description