|
|
@ -1,14 +1,18 @@ |
|
|
|
using System.Linq; |
|
|
|
using Xamarin.Forms; |
|
|
|
using eShopOnContainers.Core.Effects; |
|
|
|
|
|
|
|
namespace eShopOnContainers.Core.Effects |
|
|
|
namespace eShopOnContainers.Core.Behaviors |
|
|
|
{ |
|
|
|
public static class LineColorEffect |
|
|
|
public static class LineColorBehavior |
|
|
|
{ |
|
|
|
public static readonly BindableProperty ApplyLineColorProperty = |
|
|
|
BindableProperty.CreateAttached("ApplyLineColor", typeof(bool), typeof(LineColorEffect), false, |
|
|
|
BindableProperty.CreateAttached("ApplyLineColor", typeof(bool), typeof(LineColorBehavior), false, |
|
|
|
propertyChanged: OnApplyLineColorChanged); |
|
|
|
|
|
|
|
public static readonly BindableProperty LineColorProperty = |
|
|
|
BindableProperty.CreateAttached("LineColor", typeof(Color), typeof(LineColorBehavior), Color.Default); |
|
|
|
|
|
|
|
public static bool GetApplyLineColor(BindableObject view) |
|
|
|
{ |
|
|
|
return (bool)view.GetValue(ApplyLineColorProperty); |
|
|
@ -19,6 +23,16 @@ namespace eShopOnContainers.Core.Effects |
|
|
|
view.SetValue(ApplyLineColorProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
public static Color GetLineColor(BindableObject view) |
|
|
|
{ |
|
|
|
return (Color)view.GetValue(LineColorProperty); |
|
|
|
} |
|
|
|
|
|
|
|
public static void SetLineColor(BindableObject view, Color value) |
|
|
|
{ |
|
|
|
view.SetValue(LineColorProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
private static void OnApplyLineColorChanged(BindableObject bindable, object oldValue, object newValue) |
|
|
|
{ |
|
|
|
var view = bindable as View; |
|
|
@ -43,25 +57,5 @@ namespace eShopOnContainers.Core.Effects |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static readonly BindableProperty LineColorProperty = |
|
|
|
BindableProperty.CreateAttached("LineColor", typeof(Color), typeof(LineColorEffect), Color.Default); |
|
|
|
|
|
|
|
public static Color GetLineColor(BindableObject view) |
|
|
|
{ |
|
|
|
return (Color)view.GetValue(LineColorProperty); |
|
|
|
} |
|
|
|
|
|
|
|
public static void SetLineColor(BindableObject view, Color value) |
|
|
|
{ |
|
|
|
view.SetValue(LineColorProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
class EntryLineColorEffect : RoutingEffect |
|
|
|
{ |
|
|
|
public EntryLineColorEffect() : base("eShopOnContainers.EntryLineColorEffect") |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |