Fixed conflicts between System.Graphics and Xamarin.Forms primitives
This commit is contained in:
Родитель
be4f7adb66
Коммит
027cd0f946
|
@ -19,7 +19,7 @@
|
|||
HeightRequest="100"
|
||||
BorderColor="DarkBlue"
|
||||
BackgroundColor="LightBlue"
|
||||
CornerRadius="12"
|
||||
CornerRadius="12, 0, 0, 24"
|
||||
HasShadow="True">
|
||||
<Grid>
|
||||
<Label
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Graphics;
|
|||
using System.Runtime.CompilerServices;
|
||||
using GraphicsControls.Effects;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Graphics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Graphics;
|
|||
using System.Runtime.CompilerServices;
|
||||
using GraphicsControls.Extensions;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Graphics;
|
|||
using System.Runtime.CompilerServices;
|
||||
using GraphicsControls.Extensions;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
|
@ -6,7 +6,7 @@ using XColor = Xamarin.Forms.Color;
|
|||
namespace GraphicsControls
|
||||
{
|
||||
[ContentProperty(nameof(Content))]
|
||||
public class Frame : GraphicsView, ICornerRadius
|
||||
public class Frame : GraphicsView
|
||||
{
|
||||
public static new readonly BindableProperty BackgroundColorProperty =
|
||||
BindableProperty.Create(nameof(BackgroundColor), typeof(XColor), typeof(Frame), XColor.Default);
|
||||
|
@ -14,7 +14,8 @@ namespace GraphicsControls
|
|||
public static readonly BindableProperty BorderColorProperty =
|
||||
BindableProperty.Create(nameof(BorderColor), typeof(XColor), typeof(Frame), XColor.Default);
|
||||
|
||||
public static readonly BindableProperty CornerRadiusProperty = CornerRadiusElement.CornerRadiusProperty;
|
||||
public static readonly BindableProperty CornerRadiusProperty =
|
||||
BindableProperty.Create(nameof(CornerRadius), typeof(CornerRadius), typeof(Frame), default(CornerRadius));
|
||||
|
||||
public static readonly BindableProperty HasShadowProperty =
|
||||
BindableProperty.Create(nameof(HasShadow), typeof(bool), typeof(Frame), true);
|
||||
|
@ -31,10 +32,10 @@ namespace GraphicsControls
|
|||
set { SetValue(BorderColorProperty, value); }
|
||||
}
|
||||
|
||||
public double CornerRadius
|
||||
public CornerRadius CornerRadius
|
||||
{
|
||||
get { return (double)GetValue(CornerRadiusElement.CornerRadiusProperty); }
|
||||
set { SetValue(CornerRadiusElement.CornerRadiusProperty, value); }
|
||||
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
|
||||
set { SetValue(CornerRadiusProperty, value); }
|
||||
}
|
||||
|
||||
public bool HasShadow
|
||||
|
@ -72,7 +73,7 @@ namespace GraphicsControls
|
|||
var height = dirtyRect.Height - CanvasDefaults.DefaultShadowBlur * 2;
|
||||
var width = dirtyRect.Width - CanvasDefaults.DefaultShadowBlur * 2;
|
||||
|
||||
canvas.FillRoundedRectangle(x, y, width, height, (float)CornerRadius);
|
||||
canvas.FillRoundedRectangle(x, y, width, height, (float)CornerRadius.TopLeft, (float)CornerRadius.TopRight, (float)CornerRadius.BottomLeft, (float)CornerRadius.BottomRight);
|
||||
|
||||
canvas.RestoreState();
|
||||
}
|
||||
|
@ -89,7 +90,7 @@ namespace GraphicsControls
|
|||
var height = dirtyRect.Height - CanvasDefaults.DefaultShadowBlur * 2;
|
||||
var width = dirtyRect.Width - CanvasDefaults.DefaultShadowBlur * 2;
|
||||
|
||||
canvas.DrawRoundedRectangle(x, y, width, height, (float)CornerRadius);
|
||||
canvas.DrawRoundedRectangle(x, y, width, height, (float)CornerRadius.TopLeft, (float)CornerRadius.TopRight, (float)CornerRadius.BottomLeft, (float)CornerRadius.BottomRight);
|
||||
|
||||
canvas.RestoreState();
|
||||
}
|
||||
|
@ -109,7 +110,7 @@ namespace GraphicsControls
|
|||
var height = dirtyRect.Height - (CanvasDefaults.DefaultShadowBlur * 2);
|
||||
var width = dirtyRect.Width - (CanvasDefaults.DefaultShadowBlur * 2);
|
||||
|
||||
canvas.FillRoundedRectangle(x, y, width, height, (float)CornerRadius);
|
||||
canvas.FillRoundedRectangle(x, y, width, height, (float)CornerRadius.TopLeft, (float)CornerRadius.TopRight, (float)CornerRadius.BottomLeft, (float)CornerRadius.BottomRight);
|
||||
|
||||
canvas.RestoreState();
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ using APointF = Android.Graphics.PointF;
|
|||
using AView = Android.Views.View;
|
||||
using GColor = System.Graphics.Color;
|
||||
using GraphicsView = GraphicsControls.GraphicsView;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
[assembly: ExportRenderer(typeof(GraphicsView), typeof(GraphicsViewRenderer))]
|
||||
namespace GraphicsControls.Android
|
||||
|
|
|
@ -9,6 +9,7 @@ using GraphicsControls.iOS;
|
|||
using System.ComponentModel;
|
||||
using GraphicsControls.Extensions;
|
||||
using GraphicsView = GraphicsControls.GraphicsView;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
[assembly: ExportRenderer(typeof(GraphicsView), typeof(GraphicsViewRenderer))]
|
||||
namespace GraphicsControls.iOS
|
||||
|
|
|
@ -8,6 +8,7 @@ using Xamarin.Forms.Platform.MacOS;
|
|||
using GraphicsControls.Mac;
|
||||
using System.ComponentModel;
|
||||
using GraphicsView = GraphicsControls.GraphicsView;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
[assembly: ExportRenderer(typeof(GraphicsView), typeof(GraphicsViewRenderer))]
|
||||
namespace GraphicsControls.Mac
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Graphics;
|
||||
using GraphicsControls.Effects;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
namespace GraphicsControls
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Graphics;
|
||||
using GraphicsControls.Effects;
|
||||
using Point = Xamarin.Forms.Point;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
namespace GraphicsControls
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Windows.Input;
|
||||
using Xamarin.Forms;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
using Point = System.Graphics.Point;
|
||||
|
||||
namespace GraphicsControls
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Runtime.CompilerServices;
|
|||
using GraphicsControls.Effects;
|
||||
using GraphicsControls.Helpers;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Graphics;
|
||||
using Xamarin.Forms;
|
||||
using Point = System.Graphics.Point;
|
||||
using XColor = Xamarin.Forms.Color;
|
||||
|
||||
namespace GraphicsControls
|
||||
|
|
Загрузка…
Ссылка в новой задаче