Exemple #1
0
        private UIFont GetFontStyle(MuseoLabel xfLabel)
        {
            switch (xfLabel.FontAttributes)
            {
            case FontAttributes.Bold:
                retFont = UIFont.FromName("MuseoSans-700", (float)xfControl.FontSize);
                break;

            case FontAttributes.Italic:
                retFont = UIFont.FromName("MuseoSans-300Italic", (float)xfControl.FontSize);
                break;

            default:
                retFont = UIFont.FromName("MuseoSansCyrl-300", (float)xfControl.FontSize);
                break;
            }
            return(retFont);
        }
Exemple #2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Label> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                return;
            }

            if (this.Element != null)
            {
                xfControl = this.Element as MuseoLabel;
                var fontStyle = GetFontStyle(xfControl);

                if (fontStyle != null)
                {
                    Control.Font = fontStyle;
                }
            }
        }