Example #1
0
        /// <inheritdoc />
        public override void LayoutControls()
        {
            var bottomToolbar = new HorizontalStackPanel
            {
                Size = new SizeF(Size.Width, 40)
            };

            bottomToolbar.Location = new PointF(0, Bounds.Height - bottomToolbar.Size.Height);

            bottomToolbar.Add(new WiFiIndicator
            {
                Size      = new SizeF(50, 40),
                TextAlign = RectAlign.Top | RectAlign.Center
            });
            bottomToolbar.Add(new BatteryIndicator
            {
                Size      = new SizeF(50, 40),
                TextAlign = RectAlign.Top | RectAlign.Center
            });
            bottomToolbar.Add(new Label
            {
                Text      = $"{PassiveDevices.Battery.GetPercentage()*100:F0}%",
                Font      = Fonts.SegoeUi.CreateFont(28),
                TextAlign = RectAlign.Top | RectAlign.Center,
                Size      = new SizeF(80, 40)
            });

            Add(bottomToolbar);
        }
Example #2
0
        public void AddTab(string name, IControl content)
        {
            var newTab = new Tab(name, content);

            tabs.Add(newTab);
            tabsPanel.Add(newTab.Header);
            if (tabs.Count == 1)
            {
                SelectTab(0);
            }
        }