Exemplo n.º 1
0
        public DockPanel generateDockPanel(Distro distro)
        {
            DockPanel dockPanel = new DockPanel();

            dockPanel.Children.Add(generatePanel(distro));
            StackPanel panel = new StackPanel();

            dockPanel.Children.Add(panel);
            if (distro.succeed)
            {
                panel.Children.Add(createLabel("VALID", new SolidColorBrush(Colors.Green)));
            }
            else
            {
                panel.Children.Add(createLabel("ERROR", new SolidColorBrush(Colors.Red)));
            }
            panel.Children.Add(createLabel("WSL" + distro.wslVersion, new SolidColorBrush(Colors.Black)));

            panel.Children.Add(createLabel(distro.distroStatus, new SolidColorBrush(Colors.Black)));
            if (distro.isDefaultDistro)
            {
                panel.Children.Add(createLabel("Default", new SolidColorBrush(Colors.Blue)));
            }
            return(dockPanel);
        }
Exemplo n.º 2
0
        public StackPanel generatePanel(Distro distro)
        {
            var   distroName = distro.distroName;
            Label label      = new Label();

            label.FontSize = 32;
            label.Content  = distroName;

            Image img = new Image();

            img.Source = new BitmapImage(new Uri(@"/Images/ubuntu.png", UriKind.Relative));
            img.Height = 100;
            img.Width  = 100;
            StackPanel panel = new StackPanel();

            panel.Children.Add(img);
            panel.Children.Add(label);

            return(panel);
        }