2016-08-30 20:46:14 +03:00
|
|
|
using System;
|
2016-03-22 23:02:25 +03:00
|
|
|
using Xamarin.Forms.Platform;
|
|
|
|
|
|
|
|
namespace Xamarin.Forms
|
|
|
|
{
|
|
|
|
[ContentProperty("Content")]
|
|
|
|
[RenderWith(typeof(_FrameRenderer))]
|
2016-08-30 20:46:14 +03:00
|
|
|
public class Frame : ContentView, IElementConfiguration<Frame>
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
public static readonly BindableProperty OutlineColorProperty = BindableProperty.Create("OutlineColor", typeof(Color), typeof(Frame), Color.Default);
|
|
|
|
|
|
|
|
public static readonly BindableProperty HasShadowProperty = BindableProperty.Create("HasShadow", typeof(bool), typeof(Frame), true);
|
|
|
|
|
2016-08-30 20:46:14 +03:00
|
|
|
readonly Lazy<PlatformConfigurationRegistry<Frame>> _platformConfigurationRegistry;
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
public Frame()
|
|
|
|
{
|
|
|
|
Padding = new Size(20, 20);
|
2016-08-30 20:46:14 +03:00
|
|
|
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Frame>>(() => new PlatformConfigurationRegistry<Frame>(this));
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public bool HasShadow
|
|
|
|
{
|
|
|
|
get { return (bool)GetValue(HasShadowProperty); }
|
|
|
|
set { SetValue(HasShadowProperty, value); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public Color OutlineColor
|
|
|
|
{
|
|
|
|
get { return (Color)GetValue(OutlineColorProperty); }
|
|
|
|
set { SetValue(OutlineColorProperty, value); }
|
|
|
|
}
|
2016-08-30 20:46:14 +03:00
|
|
|
|
|
|
|
public IPlatformElementConfiguration<T, Frame> On<T>() where T : IConfigPlatform
|
|
|
|
{
|
|
|
|
return _platformConfigurationRegistry.Value.On<T>();
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
}
|