2020-05-19 03:56:25 +03:00
|
|
|
using System.Maui;
|
|
|
|
using System.Maui.Platform.Tizen;
|
|
|
|
using System.Maui.Platform.Tizen.Native;
|
|
|
|
using System.Maui.Material.Tizen;
|
2019-04-15 19:55:56 +03:00
|
|
|
using Tizen.NET.MaterialComponents;
|
|
|
|
|
2019-08-29 20:42:59 +03:00
|
|
|
[assembly: ExportRenderer(typeof(Frame), typeof(MaterialFrameRenderer), new[] { typeof(VisualMarker.MaterialVisual) }, Priority = short.MinValue)]
|
2020-05-19 03:56:25 +03:00
|
|
|
namespace System.Maui.Material.Tizen
|
2019-04-15 19:55:56 +03:00
|
|
|
{
|
|
|
|
public class MaterialFrameRenderer : ViewRenderer<Frame, MCard>
|
|
|
|
{
|
|
|
|
public MaterialFrameRenderer()
|
|
|
|
{
|
|
|
|
RegisterPropertyHandler(Frame.BorderColorProperty, UpdateBorderColor);
|
|
|
|
RegisterPropertyHandler(Frame.HasShadowProperty, UpdateShadowVisibility);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
|
|
|
|
{
|
|
|
|
if (Control == null)
|
|
|
|
{
|
2020-05-19 03:56:25 +03:00
|
|
|
SetNativeControl(new MaterialCanvas(System.Maui.Maui.NativeParent));
|
2019-04-15 19:55:56 +03:00
|
|
|
}
|
|
|
|
base.OnElementChanged(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateBorderColor()
|
|
|
|
{
|
|
|
|
Control.BorderColor = Element.BorderColor.ToNative();
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateShadowVisibility()
|
|
|
|
{
|
|
|
|
Control.HasShadow = Element.HasShadow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|