BorderLayoutSample.MainScreen.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( ) : void
return void
        public override void Initialize()
        {
            base.Initialize();

            Label lblCenter;
            Label lblEast;
            Label lblNorth;
            Label lblSouth;
            Label lblWest;

            lblCenter = new Label("Center");
            lblEast = new Label("East");
            lblNorth = new Label("North");
            lblSouth = new Label("South");
            lblWest = new Label("West");

            lblCenter.Align = Label.AlignType.MIDDLECENTER;
            lblEast.Align = Label.AlignType.MIDDLECENTER;
            lblNorth.Align = Label.AlignType.MIDDLECENTER;
            lblSouth.Align = Label.AlignType.MIDDLECENTER;
            lblWest.Align = Label.AlignType.MIDDLECENTER;

            Container<BorderLayout> borderContainer = new Container<BorderLayout>(new BorderLayout());
            borderContainer.BackgroundColor = Color.Transparent;
            borderContainer.Layout.AddComponent(BorderLayout.Organization.CENTER, lblCenter);
            borderContainer.Layout.AddComponent(BorderLayout.Organization.EAST, lblEast);
            borderContainer.Layout.AddComponent(BorderLayout.Organization.NORTH, 25, lblNorth);
            borderContainer.Layout.AddComponent(BorderLayout.Organization.SOUTH, 25, lblSouth);
            borderContainer.Layout.AddComponent(BorderLayout.Organization.WEST, lblWest);

            AddComponent(borderContainer, 0, 0);
            borderContainer.Size = new Vector2(Preferences.Width, Preferences.Height / 2);
        }