public override Bound Apply(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { base.Apply(stylesheet, styleBound, maxBound); var app = UIScreen.MainScreen.ApplicationFrame; Bound bound = new Bound(app.Width, app.Height); LayoutBehaviour.Screen(stylesheet, this, _child, bound); Rectangle old = _child.Frame; _child.Frame = new Rectangle(old.Left + app.Left, old.Top + app.Top, old.Width, old.Height); // background color _view.BackgroundColor = stylesheet.GetHelper <StyleHelper> ().ColorOrClear <BackgroundColor> (this); if (OnLoad != null) { OnLoad.Execute(); } Frame = new Rectangle(app.Left, app.Top, bound); return(bound); }
void LayoutChild(IControl <View> control) { float controlWidth = Frame.Width; float controlHeight = Frame.Height; float width = _stylesheet.GetHelper <StyleHelper>().Width(control, controlWidth); float height = _stylesheet.GetHelper <StyleHelper>().Height(control, controlHeight); LayoutBehaviour.InitializeImageContainer(_stylesheet, control, ref width, ref height); Bound bound = control.Apply(_stylesheet, new Bound(width, height), new Bound(width, float.PositiveInfinity)); control.Frame = new Rectangle(0, 0, bound); }
protected override Bound LayoutChildren(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { Bound bound = LayoutBehaviour.Vertical(stylesheet, this, Childrens, styleBound, maxBound, true); if (Childrens.Count > 0) { Behavour.Borders.Add(Childrens[0].Frame.Top); foreach (IControl <View> control in Childrens) { Behavour.Borders.Add(control.Frame.Bottom); } } Behavour.ScrolledMeasure = bound.Height; return(bound); }
void LayoutChild(IControl <UIView> control) { StyleHelper style = _stylesheet.GetHelper <StyleHelper> (); float parentWidth = _view.Frame.Width; float parentHeight = _view.Frame.Height; float w = style.Width(control, parentWidth); float h = style.Height(control, parentHeight); LayoutBehaviour.InitializeImageContainer(_stylesheet, control, ref w, ref h); Bound bound = control.Apply(_stylesheet, new Bound(w, h), new Bound(w, float.MaxValue)); control.Frame = new Rectangle(0, 0, bound); }
protected override Bound LayoutChildren(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { _behaviour.ScrolledMeasure = styleBound.Width; Bound bound = LayoutBehaviour.Horizontal(stylesheet, this, _controls, styleBound, maxBound, true); if (_controls.Count > 0) { _behaviour.Borders.Add(_controls [0].Frame.Left); foreach (var control in _controls) { _behaviour.Borders.Add(control.Frame.Right); } } return(bound); }
protected override Bound LayoutChildren(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { return(LayoutBehaviour.Vertical(stylesheet, this, Childrens, styleBound, maxBound)); }
protected override Bound LayoutChildren(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { return(LayoutBehaviour.Dock(stylesheet, this, _controls, styleBound, maxBound)); }
protected override Bound LayoutChildren(StyleSheet.StyleSheet stylesheet, Bound styleBound, Bound maxBound) { return(LayoutBehaviour.Screen(stylesheet, this, Childrens[0], maxBound)); }