GridLengthTypeConverter 클래스

정의

문자열에서 GridLength로 변환하는 TypeConverter입니다.

[Xamarin.Forms.Xaml.TypeConversion(typeof(Xamarin.Forms.GridLength))]
public class GridLengthTypeConverter : Xamarin.Forms.TypeConverter
type GridLengthTypeConverter = class
    inherit TypeConverter
상속
GridLengthTypeConverter
특성

설명

다음 예제에서는 의 몇 가지 용도를 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*"));

생성자

GridLengthTypeConverter()

기본값을 사용하여 새 GridLength 개체를 만듭니다.

메서드

CanConvertFrom(Type)

파생 클래스에서 구현되는 경우 파생 형식 변환기가 sourceType을 대상 유형으로 변환할 수 있는지 여부를 나타내는 부울 값을 반환합니다.

(다음에서 상속됨 TypeConverter)
ConvertFrom(CultureInfo, Object)
사용되지 않습니다.

파생 클래스에서 구현되는 경우 value 버전이고 대상 형식으로 캐스팅할 수 있는 개체를 변환합니다.

(다음에서 상속됨 TypeConverter)
ConvertFrom(Object)
사용되지 않습니다.

현재 문화권 정보 및 oConvertFrom(CultureInfo, Object)를 호출합니다.

(다음에서 상속됨 TypeConverter)
ConvertFromInvariantString(String)

유효한 그리드 길이 설명자를 GridLength로 변환합니다.

적용 대상