private void InitAlignment() { AlignmentTestBlock = new UniversalBlock(); AlignmentTestBlock.HMembers.Children.Add("Layout test"); // configuration buttons Alignment = new ButtonBlock("Alignment: LeftOrTopEdge"); OrientationButton = new ButtonBlock("Orientation: Vertical"); Alignment.MyButton.Pushed += Alignment_Pushed; OrientationButton.MyButton.Pushed += Orientation_Pushed; // =============================================== // init layout and set preferred properties // =============================================== layoutTest = new LayoutTestBlock(); layout = layoutTest.LinearLayoutStrategy; layout.Orientation = OrientationType.Vertical; layout.Alignment = AlignmentType.LeftOrTopEdge; layout.XSpacing = 24; layout.YSpacing = 24; layout.WrapMaxSize = 950; layoutTest.MyControl.Box.Padding.SetLeftAndRight(16); layoutTest.MyControl.Box.Padding.SetTopAndBottom(32); layoutTest.MyControl.Layout(); // =============================================== AlignmentTestBlock.VMembers.Children.Add(Alignment); AlignmentTestBlock.VMembers.Children.Add(OrientationButton); AlignmentTestBlock.VMembers.Children.Add(layoutTest); this.Children.Add(AlignmentTestBlock); }
public LinearContainerControl(ILinearLayout layout) : base() { this.LinearLayoutStrategy = layout; Init(); }
protected virtual void InitLayoutStrategy() { this.LinearLayoutStrategy = new LinearLayout(OrientationType.Vertical); }