Exemplo n.º 1
0
 protected override void OnAttached()
 {
     XamarinIntro.Effects.ShadowEffect eff = (XamarinIntro.Effects.ShadowEffect) this.Element.Effects.FirstOrDefault(e => e is XamarinIntro.Effects.ShadowEffect);
     if (eff != null)
     {
         Control.Layer.ShadowRadius  = (nfloat)eff.Radius;
         Control.Layer.ShadowColor   = XamarinIntro.Effects.ShadowEffect.GetColor((Xamarin.Forms.VisualElement)Element).ToCGColor();
         Control.Layer.ShadowOffset  = new CoreGraphics.CGSize(eff.XOffset, eff.YOffset);
         Control.Layer.ShadowOpacity = 1.0f;
     }
 }
Exemplo n.º 2
0
 protected override void OnAttached()
 {
     XamarinIntro.Effects.ShadowEffect eff = (XamarinIntro.Effects.ShadowEffect) this.Element.Effects.FirstOrDefault(e => e is XamarinIntro.Effects.ShadowEffect);
     if (eff != null)
     {
         radius    = (float)eff.Radius;
         distanceX = (float)eff.XOffset;
         distanceY = (float)eff.YOffset;
         var control = Control as Android.Widget.TextView;
         Android.Graphics.Color color = XamarinIntro.Effects.ShadowEffect.GetColor((Xamarin.Forms.VisualElement)Element).ToAndroid();
         control.SetShadowLayer(radius, distanceX, distanceY, color);
     }
 }
Exemplo n.º 3
0
 protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
 {
     base.OnElementPropertyChanged(args);
     System.Diagnostics.Debug.WriteLine(args.PropertyName);
     if (args.PropertyName == XamarinIntro.Effects.ShadowEffect.ColorProperty.PropertyName)
     {
         XamarinIntro.Effects.ShadowEffect eff = (XamarinIntro.Effects.ShadowEffect) this.Element.Effects.FirstOrDefault(e => e is XamarinIntro.Effects.ShadowEffect);
         if (eff != null)
         {
             radius    = (float)eff.Radius;
             distanceX = (float)eff.XOffset;
             distanceY = (float)eff.YOffset;
             var control = Control as Android.Widget.TextView;
             Android.Graphics.Color color = XamarinIntro.Effects.ShadowEffect.GetColor((Xamarin.Forms.VisualElement)Element).ToAndroid();
             control.SetShadowLayer(radius, distanceX, distanceY, color);
         }
     }
 }