Beispiel #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                if (Element is SupportEntry)
                {
                    supportEntry = Element as SupportEntry;

                    Control.ClipsToBounds = true;
                    if (supportEntry.CornerRadius > 0)
                    {
                        //
                    }
                    else
                    {
                        Control.BorderStyle = UITextBorderStyle.None;
                    }
                    Control.Layer.CornerRadius = (float)supportEntry.CornerRadius;
                    Control.Layer.BorderWidth  = (float)supportEntry.CornerWidth;
                    Control.Layer.BorderColor  = supportEntry.EntryCornerColor.ToCGColor();

                    InitilizeDrawableInsideView(supportEntry.DrawableInside, supportEntry.DrawableInsideAligment);
                    InitlizeReturnKey();
                    InitlizePaddingInside();

                    Control.ShouldReturn += (UITextField tf) =>
                    {
                        supportEntry.RunReturnAction();
                        return(true);
                    };
                }
            }
        }
Beispiel #2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                if (Element is SupportEntry)
                {
                    supportEntry = Element as SupportEntry;

                    InitilizeBorderEntry(supportEntry.EntryCornerColor.ToAndroid());

                    if (supportEntry.PaddingInside > 0)
                    {
                        InitlizePaddingInside();
                    }
                    else
                    {
                        InitilizeDrawableInsideView(supportEntry.DrawableInside, supportEntry.DrawableInsideAligment);
                    }

                    InitlizeReturnKey();

                    Control.Gravity       = Android.Views.GravityFlags.CenterVertical;
                    Control.EditorAction += (object sender, TextView.EditorActionEventArgs args) =>
                    {
                        SwitchReturnAction();
                        supportEntry.InvokeCompleted();
                    };
                }
            }
        }