Exemple #1
0
        public override void OnElementChanged()
        {
            base.OnElementChanged();

            //layout.Add(drawable, 0, 0);

            BindColor(top, Element, c => c.BackgroundColor, Frame.OutlineColorProperty);
            BindColor(bottom, Element, c => c.BackgroundColor, Frame.OutlineColorProperty);
            BindColor(left, Element, c => c.BackgroundColor, Frame.OutlineColorProperty);
            BindColor(right, Element, c => c.BackgroundColor, Frame.OutlineColorProperty);
            layout.Add(content, (int)Element.Padding.Left, (int)Element.Padding.Top);
            layout.Add(top, 0, 0);
            layout.Add(right, 0, 0);
            layout.Add(bottom, 0, 0);
            layout.Add(left, 0, 0);
            Control.LoadComplete += (sender, args) => ResizeFrame();
            Control.SizeChanged  += (sender, args) => ResizeFrame();
            Element.OnPropertyChange(Layout.PaddingProperty, ResizeFrame);

            if (Element.Content != null)
            {
                content.SetView(Element.Content);
            }
        }