Пример #1
0
 void SetFont(SportEntry view)
 {
     if (view.Font != Font.Default)
     {
         Control.TextSize = view.Font.ToScaledPixel();
     }
 }
Пример #2
0
 void SetMaxLength(SportEntry view)
 {
     Control.ShouldChangeCharacters = (textField, range, replacementString) =>
     {
         var newLength = textField.Text.Length + replacementString.Length - range.Length;
         return(newLength <= view.MaxLength);
     };
 }
Пример #3
0
        void SetFontFamily(SportEntry view)
        {
            UIFont uiFont;

            if (!string.IsNullOrWhiteSpace(view.FontFamily) && (uiFont = view.Font.ToUIFont()) != null)
            {
                var ui = UIFont.FromName(view.FontFamily, (nfloat)(view.Font != null ? view.Font.FontSize : 17f));
                Control.Font = uiFont;
            }
        }
Пример #4
0
        void SetFont(SportEntry view)
        {
            UIFont uiFont;

            if (view.Font != Font.Default && (uiFont = view.Font.ToUIFont()) != null)
            {
                Control.Font = uiFont;
            }
            else if (view.Font == Font.Default)
            {
                Control.Font = UIFont.SystemFontOfSize(17f);
            }
        }
Пример #5
0
        void SetTextAlignment(SportEntry view)
        {
            switch (view.XAlign)
            {
            case Xamarin.Forms.TextAlignment.Center:
                Control.Gravity = GravityFlags.CenterHorizontal;
                break;

            case Xamarin.Forms.TextAlignment.End:
                Control.Gravity = GravityFlags.End;
                break;

            case Xamarin.Forms.TextAlignment.Start:
                Control.Gravity = GravityFlags.Start;
                break;
            }
        }
Пример #6
0
        void SetTextAlignment(SportEntry view)
        {
            switch (view.XAlign)
            {
            case TextAlignment.Center:
                Control.TextAlignment = UITextAlignment.Center;
                break;

            case TextAlignment.End:
                Control.TextAlignment = UITextAlignment.Right;
                break;

            case TextAlignment.Start:
                Control.TextAlignment = UITextAlignment.Left;
                break;
            }
        }
Пример #7
0
 void SetMaxLength(SportEntry view)
 {
     Control.SetFilters(new IInputFilter[] {
         new InputFilterLengthFilter(view.MaxLength)
     });
 }
Пример #8
0
 void SetBorder(SportEntry view)
 {
     Control.BorderStyle = view.HasBorder ? UITextBorderStyle.RoundedRect : UITextBorderStyle.None;
 }