GridLengthTypeConverter GridLengthTypeConverter Class

Definition

A TypeConverter that converts from strings to GridLengths.

[Xamarin.Forms.Xaml.TypeConversion(typeof(Xamarin.Forms.GridLength))]
public class GridLengthTypeConverter : Xamarin.Forms.TypeConverter
type GridLengthTypeConverter = class
    inherit TypeConverter
Inheritance
GridLengthTypeConverterGridLengthTypeConverter
Attributes

Remarks

The following example shows some uses of GridLengthTypeConverter:


            var converter = new GridLengthTypeConverter ();

            Assert.AreEqual (new GridLength (42), converter.ConvertFrom ("42"));
            Assert.AreEqual (new GridLength (42.2), converter.ConvertFrom ("42.2"));
            Assert.AreEqual (GridLength.Auto, converter.ConvertFrom ("auto"));
            Assert.AreEqual (GridLength.Auto, converter.ConvertFrom (" AuTo "));
            Assert.AreEqual (new GridLength (1, GridUnitType.Star), converter.ConvertFrom ("*"));
            Assert.AreEqual (new GridLength (42, GridUnitType.Star), converter.ConvertFrom ("42*"));
          

Constructors

GridLengthTypeConverter() GridLengthTypeConverter()

Creates a new GridLength object with default values.

Methods

CanConvertFrom(Type) CanConvertFrom(Type)

When implemented in a derived class, returns a Boolean value that indicates whether or not the derived type converter can convert sourceType to its target type.

(Inherited from TypeConverter)
ConvertFrom(CultureInfo, Object) ConvertFrom(CultureInfo, Object)

When implemented in a derived class, converts an object that is a version of value and that can be cast to the target type.

(Inherited from TypeConverter)
ConvertFrom(Object) ConvertFrom(Object)

Calls Xamarin.Forms.TypeConverter.ConvertFrom(System.Globalization.CultureInfo, object) with the current culture information and o.

(Inherited from TypeConverter)
ConvertFromInvariantString(String) ConvertFromInvariantString(String)

Converts a valid grid length descriptor in to a GridLength.

Extension Methods

LoadFromXaml<TXaml>(TXaml, String) LoadFromXaml<TXaml>(TXaml, String)

Returns an initialized view by loading the specified xaml.

LoadFromXaml<TXaml>(TXaml, Type) LoadFromXaml<TXaml>(TXaml, Type)

Returns a TXaml with the properties that are defined in the application manifest for callingType.

Applies to