This commit is contained in:
Oleksandr Liakhevych 2022-03-17 10:23:19 +02:00
Родитель 3d6a786489
Коммит 916a50b34c
4 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -363,7 +363,7 @@ namespace {componentNamespace}
{ typeof(LayoutOptions), propValue => $"AttributeHelper.LayoutOptionsToString({propValue})" },
{ typeof(Point), propValue => $"AttributeHelper.PointToString({propValue})" },
{ typeof(Thickness), propValue => $"AttributeHelper.ThicknessToString({propValue})" },
{ typeof(Rectangle), propValue => $"AttributeHelper.RectangleToString({propValue})" },
{ typeof(Rect), propValue => $"AttributeHelper.RectToString({propValue})" },
{ typeof(DateTime), propValue => $"AttributeHelper.DateTimeToString({propValue})" },
{ typeof(TimeSpan), propValue => $"AttributeHelper.TimeSpanToString({propValue})" },
{ typeof(bool), propValue => $"{propValue}" },
@ -637,7 +637,7 @@ namespace {componentHandlerNamespace}
{ typeof(LayoutOptions), "AttributeHelper.StringToLayoutOptions(attributeValue{0})" },
{ typeof(Point), "AttributeHelper.StringToPoint(attributeValue{0})" },
{ typeof(Thickness), "AttributeHelper.StringToThickness(attributeValue{0})" },
{ typeof(Rectangle), "AttributeHelper.StringToRectangle(attributeValue{0})" },
{ typeof(Rect), "AttributeHelper.StringToRect(attributeValue{0})" },
{ typeof(DateTime), "AttributeHelper.StringToDateTime(attributeValue{0})" },
{ typeof(TimeSpan), "AttributeHelper.StringToTimeSpan(attributeValue{0})" },
{ typeof(bool), "AttributeHelper.GetBool(attributeValue{0})" },

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.MobileBlazorBindings.Elements
/// <summary>
/// Helper method to serialize <see cref="Thickness" /> objects.
/// </summary>
public static string RectangleToString(Rectangle rectangle)
public static string RectToString(Rect rectangle)
{
return rectangle.ToString();
}
@ -20,7 +20,7 @@ namespace Microsoft.MobileBlazorBindings.Elements
/// <summary>
/// Helper method to deserialize <see cref="Thickness" /> objects.
/// </summary>
public static Rectangle StringToRectangle(object rectangleString, Rectangle defaultValueIfNull = default)
public static Rect StringToRect(object rectangleString, Rect defaultValueIfNull = default)
{
if (rectangleString is null)
{
@ -31,7 +31,7 @@ namespace Microsoft.MobileBlazorBindings.Elements
throw new ArgumentException("Expected parameter instance to be a string.", nameof(rectangleString));
}
return Rectangle.TryParse(rectangleAsString, out var rectangle)
return Rect.TryParse(rectangleAsString, out var rectangle)
? rectangle
: throw new ArgumentException("Cannot parse Rectangle string.");
}

Просмотреть файл

@ -62,7 +62,7 @@ namespace Microsoft.MobileBlazorBindings.Elements.Handlers
VisualElementControl.FlowDirection = (FlowDirection)AttributeHelper.GetInt(attributeValue, (int)FlowDirectionDefaultValue);
break;
case nameof(MC.VisualElement.Frame):
VisualElementControl.Frame = AttributeHelper.StringToRectangle(attributeValue);
VisualElementControl.Frame = AttributeHelper.StringToRect(attributeValue);
break;
case nameof(MC.VisualElement.HeightRequest):
VisualElementControl.HeightRequest = AttributeHelper.StringToDouble((string)attributeValue, HeightRequestDefaultValue);

Просмотреть файл

@ -22,7 +22,7 @@ namespace Microsoft.MobileBlazorBindings.Elements
[Parameter] public double? AnchorY { get; set; }
[Parameter] public Color BackgroundColor { get; set; }
[Parameter] public FlowDirection? FlowDirection { get; set; }
[Parameter] public Rectangle? Frame { get; set; }
[Parameter] public Rect? Frame { get; set; }
[Parameter] public double? HeightRequest { get; set; }
[Parameter] public bool? InputTransparent { get; set; }
[Parameter] public bool? IsEnabled { get; set; }
@ -67,7 +67,7 @@ namespace Microsoft.MobileBlazorBindings.Elements
}
if (Frame != null)
{
builder.AddAttribute(nameof(Frame), AttributeHelper.RectangleToString(Frame.Value));
builder.AddAttribute(nameof(Frame), AttributeHelper.RectToString(Frame.Value));
}
if (HeightRequest != null)
{