GridLengthTypeConverter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- 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() |
Creates a new GridLength object with default values. |
Methods
CanConvertFrom(Type) |
When implemented in a derived class, returns a Boolean value that indicates whether or not the derived type converter can convert |
ConvertFrom(CultureInfo, Object) |
Obsolete.
When implemented in a derived class, converts an object that is a version of |
ConvertFrom(Object) |
Obsolete.
Calls ConvertFrom(CultureInfo, Object) with the current culture information and |
ConvertFromInvariantString(String) |
Converts a valid grid length descriptor in to a GridLength. |