예제 #1
0
        void Init()
        {
            textBox_url       = new TextBox();
            textBox_url.Text  = "http://";
            textBox_save      = new TextBox();
            textBox_save.Text = _saveDir;

            textBox_url.TextChanged += textBox_url_TextChanged;

            button_wget = new Button
            {
                Text = "Wget"
            };
            button_wget.Click += button_wget_Click;

            var layout = new DynamicLayout {
                Padding = new Padding(20, 10), Spacing = new Size(5, 5)
            };

            var layout_left = new DynamicLayout();

            layout_left.AddColumn(textBox_url, textBox_save);

            layout.BeginHorizontal();
            layout.Add(layout_left, true);
            layout.Add(button_wget);
            layout.EndBeginHorizontal();

            Content = layout;

            Title = "Wget";
            Size  = new Size(300, 100);
        }
예제 #2
0
        void Init()
        {
            textBox_url              = new TextBox();
            textBox_url.TextChanged += textBox_url_TextChanged;
            textBox_url.Text         = "http://";

            textBox_save      = new TextBox();
            textBox_save.Text = _saveDir;

            button_wget = new Button
            {
                Text = "Wget"
            };
            button_wget.Click += button_wget_Click;

            var layout = new DynamicLayout {
                Padding = new Padding(20, 10), Spacing = new Size(5, 5)
            };

            var layout_left = new DynamicLayout();

            layout_left.AddColumn(textBox_url, textBox_save);
            layout.AddRow(layout_left, button_wget);

            Content = layout;
        }
예제 #3
0
        private DynamicLayout GenColorControl()
        {
            var layout     = new DynamicLayout();
            var layoutCtrl = new DynamicLayout();

            layoutCtrl.DefaultSpacing = new Eto.Drawing.Size(5, 5);
            layoutCtrl.DefaultPadding = new Eto.Drawing.Padding(2, 0, 0, 0);

            var gridView = GenColorPanel();

            var preset = new Button()
            {
                Text = "Preset", Width = 45, ToolTip = "Default color presets"
            };
            var moveUp = new Button()
            {
                Text = "↑", Width = 45, ToolTip = "Move a color up"
            };
            var moveDn = new Button()
            {
                Text = "↓", Width = 45, ToolTip = "Move a color down"
            };
            var flip = new Button()
            {
                Text = "Flip", Width = 45, ToolTip = "Flip the order"
            };
            var add = new Button()
            {
                Text = "+", Width = 45, ToolTip = "Add a new color"
            };
            var remove = new Button()
            {
                Text = "x", Width = 45, ToolTip = "Delete a color"
            };
            var save = new Button()
            {
                Text = "Save", Width = 45, ToolTip = "Save as a preset"
            };

            preset.Command = _vm.PresetCommand;
            moveUp.Command = _vm.MoveUpCommand;
            moveDn.Command = _vm.MoveDownCommand;
            flip.Command   = _vm.FlipCommand;
            add.Command    = _vm.AddCommand;
            remove.Command = _vm.RemoveCommand;
            save.Command   = _vm.SaveCommand;

            moveUp.Bind(_ => _.Enabled, _vm, _ => _.HasColorSelected);
            moveDn.Bind(_ => _.Enabled, _vm, _ => _.HasColorSelected);
            remove.Bind(_ => _.Enabled, _vm, _ => _.HasColorSelected);

            layoutCtrl.AddColumn(preset, save, flip, add, remove, moveUp, moveDn, null);
            layout.AddRow(gridView, layoutCtrl);
            //layout.AddRow(layoutCtrl);
            return(layout);
        }
예제 #4
0
        static Form Test2(bool setSize)
        {
            var leftPane = new DynamicLayout {
                DefaultSpacing = new Size(5, 5)
            };

            leftPane.AddColumn(new TreeGridView());

            var rightTop = new DynamicLayout();

            rightTop.AddColumn(ComboWithItems(), new Panel());

            var rightBottom = new DynamicLayout();

            rightBottom.AddRow(new DropDown(), ComboWithItems(), new Button(), new CheckBox(), null);

            using (Context)
            {
                var rightPane = new Splitter
                {
                    Orientation = Orientation.Vertical,
                    FixedPanel  = SplitterFixedPanel.Panel2,
                    Panel1      = rightTop,
                    Panel2      = rightBottom,
                    Position    = 200,
                };
                LogEvents(rightPane);

                var mainPane = new Splitter
                {
                    Orientation     = Orientation.Horizontal,
                    FixedPanel      = SplitterFixedPanel.Panel1,
                    BackgroundColor = Colors.Gray,
                    Position        = 200,
                    Panel1          = leftPane,
                    Panel2          = rightPane
                };
                LogEvents(mainPane);

                var form = new Form
                {
                    Padding = new Padding(5),
                    Content = mainPane
                };
                if (setSize)
                {
                    form.Size = new Size(600, 400);
                }
                return(form);
            }
        }
예제 #5
0
        public About()
        {
            /* dialog attributes */

            this.Text       = "About Notedown";
            this.ClientSize = new Size(300, 280);
            this.Resizable  = false;

            /* dialog controls */

            var imageView = new ImageView();

            imageView.Image = Icon.FromResource("Icon.ico");
            imageView.Size  = new Size(128, 128);

            var labelTitle = new Label();

            labelTitle.Text            = "Notedown";
            labelTitle.Size            = new Size(240, 24);
            labelTitle.Font            = new Font(FontFamily.Sans, 16);
            labelTitle.HorizontalAlign = HorizontalAlign.Center;

            var version      = Assembly.GetExecutingAssembly().GetName().Version;
            var labelVersion = new Label();

            labelVersion.Text            = string.Format("Version {0}", version);
            labelVersion.HorizontalAlign = HorizontalAlign.Center;

            var labelCopyright = new Label();

            labelCopyright.Text            = "Copyright by Andre Straubmeier";
            labelCopyright.HorizontalAlign = HorizontalAlign.Center;

            var button = new Button();

            button.Text   = "Close";
            button.Size   = new Size(90, 26);
            button.Click += delegate
            {
                Close();
            };

            /* dialog layout */

            var layout = new DynamicLayout(this);

            layout.AddColumn(imageView, labelTitle, labelVersion, labelCopyright);
            layout.AddCentered(button);
        }
예제 #6
0
        public MainForm()
        {
            // Exit if we're already running the AM2RLauncher
            // Thanks, StackOverflow! https://stackoverflow.com/questions/184084/how-to-force-c-sharp-net-app-to-run-only-one-instance-in-windows
            if (!singleInstance)
            {
                // If on Windows, set the original app to the foreground window to prevent confusion
                if (OS.IsWindows)
                {
                    Process current = Process.GetCurrentProcess();
                    Process process = Process.GetProcessesByName(current.ProcessName).First(p => p.Id == current.Id);
                    if (process != null)
                    {
                        Core.Core.SetForegroundWindow(process.MainWindowHandle);
                    }
                }
                Environment.Exit(0);
            }

            log.Info("Mutex check passed. Entering main thread.");
            log.Info("Current Launcher Version: " + VERSION);
            log.Info("Current Platform-ID is: " + Platform.ID);
            log.Info("Current OS is: " + OS.Name);

            // Set the Current Directory to the path the Launcher is located. Fixes some relative path issues.
            Environment.CurrentDirectory = CrossPlatformOperations.CURRENTPATH;
            log.Info("Set Launcher CWD to " + Environment.CurrentDirectory);

            // But log actual folder location nonetheless
            log.Info("Actual Launcher location: " + Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory));

            // Set the language to what User wanted or choose local language
            string userLanguage = CrossPlatformOperations.ReadFromConfig("Language").ToLower();

            if (!userLanguage.Equals("default"))
            {
                Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultures(CultureTypes.AllCultures).First(c => c.NativeName.ToLower().Contains(userLanguage));
            }

            log.Info("Language has been set to: " + Thread.CurrentThread.CurrentUICulture.EnglishName);

            #region VARIABLE INITIALIZATION
            log.Info("Beginning UI initialization...");

            Bitmap am2rIcon = new Bitmap(AM2RLauncher.Properties.Resources.AM2RIcon);

            // System tray indicator
            ButtonMenuItem showButton = new ButtonMenuItem {
                Text = Text.TrayButtonShow
            };
            trayIndicator = new TrayIndicator
            {
                Menu    = new ContextMenu(showButton),
                Title   = "AM2RLauncher",
                Visible = false,
                Image   = am2rIcon
            };

            // Create menubar with defaults for mac
            if (OS.IsMac)
            {
                Menu = new MenuBar();
            }

            // Create array from validCount
            profileList = new List <ProfileXML>();

            //TODO: whenever profileDropDown gets rewritten to use a datastore, scrap this
            profileNames = new List <ListItem>();
            foreach (var profile in profileList)
            {
                profileNames.Add(profile.Name);
            }

            // Custom splash texts
            string splash = Splash.GetSplash();
            log.Info("Randomly chosen splash: " + splash);

            Font smallButtonFont = new Font(SystemFont.Default, 10);

            // Create mirror list - eventually this should be platform specific!
            // We do this as a List<Uri> so we can add more dynamically on user input... if necessary.
            mirrorList = CrossPlatformOperations.GenerateMirrorList();

            // Create mirror list
            // We do this as a list<listItem> for 1) make this dynamic and 2) make ETO happy
            mirrorDescriptionList = new List <ListItem>();
            // Add each entry dynamically instead of harcoding it to two. If we have neither a github or gitlab mirror, we use the mirror itself as text
            foreach (var mirror in mirrorList)
            {
                string text = mirror;
                if (text.Contains("github.com"))
                {
                    text = Text.MirrorGithubText;
                }
                else if (text.Contains("gitlab.com"))
                {
                    text = Text.MirrorGitlabText;
                }
                mirrorDescriptionList.Add(new ListItem()
                {
                    Key = mirror, Text = text
                });
            }
            #endregion

            Icon        = new Icon(1f, am2rIcon);
            Title       = "AM2RLauncher " + VERSION + ": " + splash;
            MinimumSize = new Size(500, 400);
            // TODO: for some reason, this sometimes doesn't work on Linux. Was reported at eto, stays here until its fixed
            ClientSize = new Size(Int32.Parse(CrossPlatformOperations.ReadFromConfig("Width")), Int32.Parse(CrossPlatformOperations.ReadFromConfig("Height")));
            if (ClientSize.Width < 500)
            {
                ClientSize = new Size(500, ClientSize.Height);
            }
            if (ClientSize.Height < 400)
            {
                ClientSize = new Size(ClientSize.Width, 400);
            }
            log.Info("Start the launcher with Size: " + ClientSize.Width + ", " + ClientSize.Height);
            if (Boolean.Parse(CrossPlatformOperations.ReadFromConfig("IsMaximized")))
            {
                Maximize();
            }

            drawable = new Drawable {
                BackgroundColor = colBGNoAlpha
            };

            // Drawable paint event
            drawable.Paint += DrawablePaintEvent;
            // Some systems don't call the paintEvent by default and only do so after actual resizing
            if (OS.IsMac)
            {
                LoadComplete += (sender, e) => { Size = new Size(Size.Width + 1, Size.Height); Size = new Size(Size.Width - 1, Size.Height); }
            }
            ;

            #region MAIN WINDOW

            // Center buttons/interface panel
            var centerInterface = new DynamicLayout();

            // PLAY button
            playButton = new ColorButton
            {
                ToolTip = "",
                BackgroundColorHover = colBGHover,
                Height             = 40,
                Width              = 250,
                TextColor          = colGreen,
                TextColorDisabled  = colInactive,
                BackgroundColor    = colBG,
                FrameColor         = colGreen,
                FrameColorDisabled = colInactive
            };

            UpdateStateMachine();

            SetPlayButtonState(updateState);

            centerInterface.AddRow(playButton);

            // 2px spacer between playButton and apkButton (Windows only)
            if (OS.IsWindows)
            {
                centerInterface.AddRow(new Label {
                    BackgroundColor = colBG, Height = 2
                });
            }

            // APK button
            apkButton = new ColorButton
            {
                Text                 = Text.CreateAPK,
                Height               = 40,
                Width                = 250,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            centerInterface.AddRow(apkButton);

            progressBar = new ProgressBar
            {
                Visible = false,
                Height  = 15
            };

            // 4px spacer between APK button and progressBar (Windows only)
            if (OS.IsWindows)
            {
                centerInterface.AddRow(new Label {
                    BackgroundColor = colBG, Height = 4
                });
            }

            centerInterface.AddRow(progressBar);

            progressLabel = new Label
            {
                BackgroundColor = colBG,
                Height          = 15,
                Text            = "",
                TextColor       = colGreen,
                Visible         = false
            };

            centerInterface.AddRow(progressLabel);

            // 3px spacer between progressBar and profile label (Windows only)
            if (OS.IsWindows)
            {
                centerInterface.AddRow(new Label {
                    BackgroundColor = colBG, Height = 3
                });
            }

            profileLabel = new Label
            {
                BackgroundColor = colBG,
                Height          = 15,
                Text            = Text.CurrentProfile,
                TextColor       = colGreen
            };

            centerInterface.AddRow(profileLabel);

            // Profiles dropdown

            // Yes, we know this looks horrific on GTK. Sorry.
            // We're not exactly in a position to rewrite the entire DropDown object as a Drawable child, but if you want to, you're more than welcome!
            // Mac gets a default BackgroundColor because it looks waaaaaaay better.
            profileDropDown = new DropDown
            {
                TextColor       = colGreen,
                BackgroundColor = OS.IsWindows ? colBGNoAlpha : new Color()
            };
            // In order to not have conflicting theming, we just always respect the users theme for dropdown on GTK.
            if (OS.IsLinux)
            {
                profileDropDown = new DropDown();
            }

            profileDropDown.Items.AddRange(profileNames);   // It's actually more comfortable if it's outside, because of GTK shenanigans

            centerInterface.AddRow(profileDropDown);

            // Profiles label
            profileAuthorLabel = new Label
            {
                BackgroundColor = colBG,
                Height          = 16,
                Text            = Text.Author + " ",
                TextColor       = colGreen
            };

            centerInterface.AddRow(profileAuthorLabel);

            profileVersionLabel = new Label
            {
                BackgroundColor = colBG,
                Height          = 16,
                Text            = Text.VersionLabel + " ",
                TextColor       = colGreen
            };

            centerInterface.AddRow(profileVersionLabel);

            saveWarningLabel = new Label
            {
                Visible         = false,
                BackgroundColor = colBG,
                Width           = 20,
                Height          = 55,
                Text            = Text.SaveLocationWarning,
                TextColor       = colRed
            };

            centerInterface.AddRow(saveWarningLabel);


            // Social buttons
            Bitmap redditIcon   = new Bitmap(Resources.redditIcon48);
            var    redditButton = new ImageButton {
                ToolTip = Text.RedditToolTip, Image = redditIcon
            };
            redditButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.reddit.com/r/AM2R");

            Bitmap githubIcon   = new Bitmap(Resources.githubIcon48);
            var    githubButton = new ImageButton {
                ToolTip = Text.GithubToolTip, Image = githubIcon
            };
            githubButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.github.com/AM2R-Community-Developers");

            Bitmap youtubeIcon   = new Bitmap(Resources.youtubeIcon48);
            var    youtubeButton = new ImageButton {
                ToolTip = Text.YoutubeToolTip, Image = youtubeIcon
            };
            youtubeButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.youtube.com/c/AM2RCommunityUpdates");

            Bitmap discordIcon   = new Bitmap(Resources.discordIcon48);
            var    discordButton = new ImageButton {
                ToolTip = Text.DiscordToolTip, Image = discordIcon
            };
            discordButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://discord.gg/nk7UYPbd5u");


            // Social button panel
            var socialPanel = new DynamicLayout();
            socialPanel.BeginVertical();
            socialPanel.AddRow(redditButton);
            socialPanel.AddRow(githubButton);
            socialPanel.AddRow(youtubeButton);
            socialPanel.AddRow(discordButton);
            socialPanel.EndVertical();


            // Version number label
            Label versionLabel = new Label
            {
                Text  = "v" + VERSION + (isThisRunningFromWine ? "-WINE" : ""),
                Width = 48, TextAlignment = TextAlignment.Right, TextColor = colGreen,
                Font  = new Font(SystemFont.Default, 12)
            };

            // Tie everything together
            var mainLayout = new DynamicLayout();

            mainLayout.BeginHorizontal();
            mainLayout.AddColumn(null, socialPanel);

            mainLayout.AddSpace();
            mainLayout.AddColumn(null, centerInterface, null);
            mainLayout.AddSpace();

            // Yes, I'm hardcoding this string. Linux users can english.
            mainLayout.AddColumn(versionLabel, isThisRunningFromWine ? new Label {
                Text = "Unsupported", TextColor = colRed, TextAlignment = TextAlignment.Right
            } : null);

            drawable.Content = mainLayout;

            #endregion

            #region TABS

            #region MAIN PAGE
            // [MAIN PAGE]
            TabPage mainPage = new TabPage
            {
                BackgroundColor = colBGNoAlpha,
                Text            = Text.PlayTab,
                Content         = drawable
            };
            #endregion

            #region CHANGELOG PAGE
            // [CHANGELOG]
            Uri     changelogUri     = new Uri("https://am2r-community-developers.github.io/DistributionCenter/changelog.html");
            WebView changelogWebView = new WebView {
                Url = changelogUri
            };

            if (OS.IsUnix && !isInternetThere)
            {
                changelogWebView = new WebView();
            }

            Label changelogNoConnectionLabel = new Label
            {
                Text      = Text.NoInternetConnection,
                TextColor = colGreen
            };

            TabPage changelogPage = new TabPage
            {
                BackgroundColor = colBGNoAlpha,
                Text            = Text.ChangelogTab,

                Content = new TableLayout
                {
                    Rows =
                    {
                        changelogWebView
                    }
                }
            };

            #endregion

            #region NEWS PAGE

            // [NEWS]
            Uri     newsUri     = new Uri("https://am2r-community-developers.github.io/DistributionCenter/news.html");
            WebView newsWebView = new WebView {
                Url = newsUri
            };

            //TODO: why exactly is this check necessary?
            if (OS.IsUnix && !isInternetThere)
            {
                newsWebView = new WebView();
            }

            Label newsNoConnectionLabel = new Label
            {
                Text      = Text.NoInternetConnection,
                TextColor = colGreen
            };

            TabPage newsPage = new TabPage
            {
                Text            = Text.NewsTab,
                BackgroundColor = colBGNoAlpha,

                Content = new TableLayout
                {
                    Rows =
                    {
                        newsWebView
                    }
                }
            };

            //TODO: this is hack because on linux / mac the other way doesn't work. eto issue?
            if (OS.IsUnix && !isInternetThere)
            {
                changelogPage.Content = new TableLayout
                {
                    Rows =
                    {
                        null,
                        changelogNoConnectionLabel,
                        null
                    }
                };
                newsPage.Content = new TableLayout
                {
                    Rows =
                    {
                        null,
                        newsNoConnectionLabel,
                        null
                    }
                };
            }

            #endregion

            #region SETTINGS PAGE

            // [LAUNCHER SETTINGS]
            DynamicLayout settingsLayout = new DynamicLayout();

            // LanguageLabel
            Label languageLabel = new Label
            {
                Text      = Text.LanguageNotice,
                TextColor = colGreen
            };

            // Language DropDown menu

            List <ListItem> languageList = new List <ListItem>
            {
                Text.SystemLanguage,
                "Deutsch",
                "English",
                "Español",
                "Français",
                "Italiano",
                "Português",
                "Русский",
                "日本語",
                "中文(简体)"
            };

            languageDropDown = new DropDown
            {
                TextColor       = colGreen,
                BackgroundColor = OS.IsWindows ? colBGNoAlpha : new Color()
            };
            if (OS.IsLinux)
            {
                languageDropDown = new DropDown();
            }

            languageDropDown.Items.AddRange(languageList);

            var tmpLanguage = CrossPlatformOperations.ReadFromConfig("Language");
            languageDropDown.SelectedIndex = tmpLanguage == "Default" ? 0 : languageDropDown.Items.IndexOf(languageDropDown.Items.FirstOrDefault(x => x.Text.Equals(tmpLanguage)));

            if (languageDropDown.SelectedIndex == -1)
            {
                log.Info("User has tried to use " + tmpLanguage + " as a Language, but it was not found. Reverting to System Language");
                languageDropDown.SelectedIndex = 0;
            }

            // autoUpdateAM2R checkbox
            autoUpdateAM2RCheck = new CheckBox
            {
                Checked   = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateAM2R")),
                Text      = Text.AutoUpdateAM2R,
                TextColor = colGreen
            };


            // autoUpdateLauncher checkbox
            autoUpdateLauncherCheck = new CheckBox
            {
                Checked   = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateLauncher")),
                Text      = Text.AutoUpdateLauncher,
                TextColor = colGreen
            };

            // HQ music, PC
            hqMusicPCCheck = new CheckBox
            {
                Checked   = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQPC")),
                Text      = Text.HighQualityPC,
                TextColor = colGreen
            };

            // HQ music, Android
            hqMusicAndroidCheck = new CheckBox
            {
                Checked   = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQAndroid")),
                Text      = Text.HighQualityAndroid,
                TextColor = colGreen
            };

            // Create game debug logs
            profileDebugLogCheck = new CheckBox
            {
                Checked   = bool.Parse(CrossPlatformOperations.ReadFromConfig("ProfileDebugLog")),
                Text      = Text.ProfileDebugCheckBox,
                TextColor = colGreen
            };

            // Custom environment variables label
            Label customEnvVarLabel = new Label();
            if (OS.IsLinux)
            {
                customEnvVarLabel = new Label
                {
                    Text      = Text.CustomEnvVarLabel,
                    TextColor = colGreen
                };
            }

            // Custom environment variables textbox
            customEnvVarTextBox = null;
            if (OS.IsLinux)
            {
                customEnvVarTextBox = new TextBox
                {
                    Text            = CrossPlatformOperations.ReadFromConfig("CustomEnvVar"),
                    BackgroundColor = colBGNoAlpha,
                    TextColor       = colGreen
                };
            }

            // Mirror list
            mirrorLabel = new Label
            {
                Text      = Text.DownloadSource,
                TextColor = colGreen
            };

            mirrorDropDown = new DropDown
            {
                TextColor       = colGreen,
                BackgroundColor = OS.IsWindows ? colBGNoAlpha : new Color()
            };
            if (OS.IsLinux)
            {
                mirrorDropDown = new DropDown();
            }

            mirrorDropDown.Items.AddRange(mirrorDescriptionList);   // As above, find a way to get this inside the dropDown definition
            mirrorIndex = (Int32.Parse(CrossPlatformOperations.ReadFromConfig("MirrorIndex")) < mirrorDropDown.Items.Count) ? Int32.Parse(CrossPlatformOperations.ReadFromConfig("MirrorIndex"))
                                                                                                                            : 0;
            mirrorDropDown.SelectedIndex = mirrorIndex;

            currentMirror = mirrorList[mirrorDropDown.SelectedIndex];

            // Custom mirror
            customMirrorCheck = new CheckBox
            {
                Checked   = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("CustomMirrorEnabled")),
                Text      = Text.CustomMirrorCheck,
                TextColor = colGreen
            };

            customMirrorTextBox = new TextBox
            {
                Text            = CrossPlatformOperations.ReadFromConfig("CustomMirrorText"),
                BackgroundColor = colBGNoAlpha,
                TextColor       = colGreen
            };

            EnableMirrorControlsAccordingly();

            settingsLayout.BeginHorizontal();
            settingsLayout.AddSpace();
            settingsLayout.AddColumn(null, languageLabel, languageDropDown, autoUpdateAM2RCheck, autoUpdateLauncherCheck, hqMusicPCCheck, hqMusicAndroidCheck, profileDebugLogCheck, customEnvVarLabel, (Control)customEnvVarTextBox ?? new Label(), mirrorLabel, mirrorDropDown, customMirrorCheck, customMirrorTextBox, null);
            settingsLayout.AddSpace();

            TabPage settingsPage = new TabPage
            {
                BackgroundColor = colBGNoAlpha,
                Content         = settingsLayout,
                Text            = Text.LauncherSettingsTab
            };

            #endregion

            #region MODSETTINGS PAGE

            // [MOD SETTINGS]
            DynamicLayout modSettingsLayout = new DynamicLayout();


            addModButton = new ColorButton
            {
                ToolTip              = null,
                Text                 = Text.AddNewMod,
                Font                 = smallButtonFont,
                Height               = 30,
                Width                = 275,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            Label modSpacer = new Label
            {
                Height = 14
            };

            settingsProfileLabel = new Label
            {
                Text      = Text.CurrentProfile,
                TextColor = colGreen,
                Width     = 275
            };

            modSettingsProfileDropDown = new DropDown
            {
                TextColor       = colGreen,
                BackgroundColor = OS.IsWindows ? colBGNoAlpha : new Color()
            };

            // In order to not have conflicting theming, we just always respect the users theme for dropdown on GTK.
            if (OS.IsLinux)
            {
                modSettingsProfileDropDown = new DropDown();
            }

            modSettingsProfileDropDown.Items.AddRange(profileNames);   // It's actually more comfortable if it's outside, because of GTK shenanigans

            profileButton = new ColorButton
            {
                ToolTip              = null,
                Text                 = Text.OpenProfileFolder,
                Font                 = smallButtonFont,
                Height               = 30,
                Width                = 275,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            saveButton = new ColorButton
            {
                ToolTip              = null,
                Text                 = Text.OpenSaveFolder,
                Font                 = smallButtonFont,
                Height               = 30,
                Width                = 275,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            updateModButton = new ColorButton
            {
                ToolTip              = null,
                Text                 = Text.UpdateModButtonText,
                Font                 = smallButtonFont,
                Height               = 30,
                Width                = 275,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            deleteModButton = new ColorButton
            {
                ToolTip              = null,
                Text                 = Text.DeleteModButtonText,
                Font                 = smallButtonFont,
                Height               = 30,
                Width                = 275,
                TextColor            = colGreen,
                BackgroundColor      = colBG,
                FrameColor           = colGreen,
                BackgroundColorHover = colBGHover
            };

            profileNotesTextArea = new TextArea
            {
                ReadOnly        = true,
                BackgroundColor = colBGNoAlpha,
                TextColor       = colInactive,
                SpellCheck      = false,
                Width           = 275,
                Height          = 150,
                Text            = Text.ProfileNotes
            };

            modSettingsLayout.BeginHorizontal();
            modSettingsLayout.AddSpace();
            modSettingsLayout.AddColumn(null, addModButton, modSpacer, settingsProfileLabel, modSettingsProfileDropDown, profileButton, saveButton, updateModButton, deleteModButton, profileNotesTextArea, null);
            modSettingsLayout.AddSpace();

            TabPage modSettingsPage = new TabPage
            {
                BackgroundColor = colBGNoAlpha,
                Content         = modSettingsLayout,
                Text            = Text.ModSettingsTab
            };

            #endregion

            #endregion

            Content = new TabControl
            {
                Pages =
                {
                    mainPage,

                    changelogPage,

                    newsPage,

                    settingsPage,

                    modSettingsPage
                }
            };

            #region EVENTS
            log.Info("All UI objects have been initialized, UI has been set up.");
            log.Info("Beginning event linkage...");

            Closing          += MainformClosing;
            showButton.Click += ShowButtonClick;
            profileDropDown.SelectedIndexChanged   += ProfileDropDownSelectedIndexChanged;
            languageDropDown.SelectedIndexChanged  += LanguageDropDownSelectedIndexChanged;
            autoUpdateAM2RCheck.CheckedChanged     += AutoUpdateAM2RCheckChanged;
            autoUpdateLauncherCheck.CheckedChanged += AutoUpdateLauncherCheckChanged;
            hqMusicAndroidCheck.CheckedChanged     += HqMusicAndroidCheckChanged;
            hqMusicPCCheck.CheckedChanged          += HqMusicPCCheckChanged;
            customMirrorCheck.CheckedChanged       += CustomMirrorCheckChanged;
            apkButton.Click                                 += ApkButtonClickEvent;
            apkButton.LoadComplete                          += (sender, e) => UpdateApkState();
            profileDropDown.LoadComplete                    += (sender, e) => UpdateProfileState();
            playButton.Click                                += PlayButtonClickEvent;
            playButton.LoadComplete                         += PlayButtonLoadComplete;
            customMirrorTextBox.LostFocus                   += CustomMirrorTextBoxLostFocus;
            mirrorDropDown.SelectedIndexChanged             += MirrorDropDownSelectedIndexChanged;
            modSettingsLayout.LoadComplete                  += ProfileLayoutLoadComplete;
            addModButton.Click                              += AddModButtonClicked;
            profileButton.Click                             += ProfileDataButtonClickEvent;
            saveButton.Click                                += SaveButtonClickEvent;
            modSettingsProfileDropDown.SelectedIndexChanged += ModSettingsProfileDropDownSelectedIndexChanged;
            deleteModButton.Click                           += DeleteModButtonClicked;
            updateModButton.Click                           += UpdateModButtonClicked;
            profileDebugLogCheck.CheckedChanged             += ProfileDebugLogCheckedChanged;
            if (OS.IsLinux)
            {
                customEnvVarTextBox.LostFocus += CustomEnvVarTextBoxLostFocus;
            }

            //TODO: Retest if these now work on mac
            newsWebView.DocumentLoaded      += (sender, e) => ChangeToEmptyPageOnNoInternet(newsPage, newsNoConnectionLabel);
            changelogWebView.DocumentLoaded += (sender, e) => ChangeToEmptyPageOnNoInternet(changelogPage, changelogNoConnectionLabel);

            log.Info("Events linked successfully.");

            #endregion
        }
예제 #7
0
        public DebugWindow(DebugWindowViewModel viewModel)
        {
            Title       = "Debugger";
            DataContext = viewModel;

            var layout = new DynamicLayout
            {
                DefaultSpacing = new Size(20, 10),
                Padding        = new Padding(20, 10)
            };

            layout.BeginVertical();

            layout.BeginHorizontal();

            var disassemblerTextBox = new AutoLoadingRichTextArea
            {
                Font     = new Font("monospace", 10),
                Width    = 300,
                ReadOnly = true
            };

            disassemblerTextBox.TextBinding.BindDataContext <DebugWindowViewModel>(m => m.DisassembedProgramText);
            disassemblerTextBox.BindDataContext(t => t.BackgroundColor,
                                                Binding.Property <bool>(nameof(DebugWindowViewModel.EmulationIsRunning))
                                                .Convert(m => m ? Colors.DarkGray : Colors.White));

            layout.Add(disassemblerTextBox);

            layout.BeginVertical();

            layout.BeginHorizontal();

            layout.BeginVertical();

            var runHaltButton = new Button();

            runHaltButton.TextBinding.BindDataContext(
                Binding.Property <bool>(nameof(DebugWindowViewModel.EmulationIsRunning))
                .Convert(b => b ? "Halt" : "Run"));
            runHaltButton.Command = new Command((s, a) =>
            {
                if (viewModel.EmulationIsRunning)
                {
                    viewModel.HaltEmulation();
                }
                else
                {
                    viewModel.StartEmulation();
                }
            });
            layout.Add(runHaltButton);

            var stepButton = new Button
            {
                Text    = "Step",
                Command = new Command((s, a) => viewModel.Step())
            };

            stepButton.Bind(b => b.Enabled, viewModel,
                            Binding.Property((DebugWindowViewModel m) => m.EmulationIsRunning).Convert(v => !v));
            layout.Add(stepButton);

            layout.Add(null);

            _registerFieldControl = new RegisterFieldControl(viewModel.State.Registers);
            layout.Add(_registerFieldControl);

            viewModel.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "State")
                {
                    _registerFieldControl.UpdateBindings(BindingUpdateMode.Destination);
                }
            };

            layout.EndVertical();

            layout.EndBeginHorizontal();

            layout.EndBeginVertical();

            var tilesetView = new ImageView();

            tilesetView.BindDataContext(v => v.Image, (DebugWindowViewModel vm) => vm.Tileset, DualBindingMode.OneWay);
            layout.AddColumn(tilesetView, new Label {
                Text = "Tileset"
            });

            layout.EndBeginVertical();

            var tilemap0View = new ImageView();

            tilemap0View.BindDataContext(v => v.Image, (DebugWindowViewModel vm) => vm.Tilemap0, DualBindingMode.OneWay);
            layout.AddColumn(tilemap0View, new Label {
                Text = "Tilemap #0"
            });

            layout.EndBeginVertical();

            var tilemap1View = new ImageView();

            tilemap1View.BindDataContext(v => v.Image, (DebugWindowViewModel vm) => vm.Tilemap1, DualBindingMode.OneWay);
            layout.AddColumn(tilemap1View, new Label {
                Text = "Tilemap #1"
            });

            layout.EndVertical();

            layout.EndHorizontal();

            layout.EndVertical();

            Content = layout;
            viewModel.Refresh();
        }
예제 #8
0
        public ProjectWizardPageView(ProjectWizardPageModel model)
        {
            var content = new DynamicLayout
            {
                Spacing = new Size(10, 10)
            };

            if (model.SupportsAppName)
            {
                var nameBox = new TextBox();
                nameBox.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.AppName);
                Application.Instance.AsyncInvoke(nameBox.Focus);

                var nameValid = new Label {
                    TextColor = Colors.Red
                };
                nameValid.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AppNameInvalid);
                nameValid.BindDataContext(c => c.Text, (ProjectWizardPageModel m) => m.AppNameValidationText);


                content.BeginHorizontal();
                content.Add(new Label {
                    Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center
                });
                content.AddColumn(nameBox, nameValid);
                content.EndHorizontal();
            }
            else if (!string.IsNullOrEmpty(model.AppName))
            {
                var label = new Label {
                    Text = model.AppName, VerticalAlignment = VerticalAlignment.Center
                };
                content.AddRow(new Label {
                    Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center
                }, label);
            }

            if (model.SupportsSeparated)
            {
                var platformTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Vertical,
                    Spacing     = new Size(0, 0),
                    Items       =
                    {
                        new ListItem {
                            Text = "Single Windows, Linux, and Mac desktop project", Key = "combined"
                        },
                        new ListItem {
                            Text = "Separate projects for each platform", Key = "separate"
                        }
                    }
                };
                platformTypeList.SelectedKeyBinding
                .Convert(v => v == "separate", v => v ? "separate" : "combined")
                .BindDataContext((ProjectWizardPageModel m) => m.Separate);
                content.AddRow(new Label {
                    Text = "Launcher:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center
                }, platformTypeList);
            }

            if (model.SupportsXamMac)
            {
                var cb = new CheckBox
                {
                    Text    = "Include Xamarin.Mac project",
                    ToolTip = "This enables you to bundle mono with your app so your users don't have to install it separately.  You can only compile this on a Mac"
                };
                cb.CheckedBinding.BindDataContext((ProjectWizardPageModel m) => m.IncludeXamMac);
                content.AddRow(new Panel(), cb);
            }

            /*
             * eventually select platforms to include?
             *
             * var platformCheckBoxes = new DynamicLayout();
             * platformCheckBoxes.BeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "Gtk2" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Gtk3" });
             * platformCheckBoxes.EndBeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "WinForms" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Wpf" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Direct2D" });
             * platformCheckBoxes.EndBeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "Mac" });
             * platformCheckBoxes.Add(new CheckBox { Text = "XamMac" });
             * platformCheckBoxes.Add(new CheckBox { Text = "XamMac2" });
             * platformCheckBoxes.EndHorizontal();
             *
             * content.Rows.Add(new TableRow(new Label { Text = "Platforms:", TextAlignment = TextAlignment.Right }, platformCheckBoxes));
             * /**/

            if (model.SupportsProjectType)
            {
                var sharedCodeList = new RadioButtonList
                {
                    Orientation = Orientation.Vertical,
                    Spacing     = new Size(0, 0),
                };
                if (model.SupportsPCL)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = "Portable Class Library", Key = "pcl"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "pcl", v => v ? "pcl" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UsePCL);
                }
                if (model.SupportsNetStandard)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = ".NET Standard", Key = "netstandard"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "netstandard", v => v ? "netstandard" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseNetStandard);
                }
                if (model.SupportsSAL)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = "Shared Project", Key = "sal"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "sal", v => v ? "sal" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseSAL);
                }

                sharedCodeList.Items.Add(new ListItem {
                    Text = "Full .NET", Key = "net"
                });
                sharedCodeList.SelectedKeyBinding.Convert(v => v == "net", v => v ? "net" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseNET);

                content.AddRow(new Label {
                    Text = model.IsLibrary ? "Type:" : "Shared Code:", TextAlignment = TextAlignment.Right
                }, sharedCodeList);
            }

            if (model.SupportsPanelType)
            {
                var panelTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Horizontal,
                    Spacing     = new Size(0, 0),
                };

                panelTypeList.Items.Add(new ListItem {
                    Text = "Code", Key = "code"
                });
                panelTypeList.SelectedKeyBinding.BindDataContext((ProjectWizardPageModel m) => m.Mode);

                if (model.SupportsXeto)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Xaml", Key = "xaml"
                    });
                }
                if (model.SupportsJeto)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Json", Key = "json"
                    });
                }
                if (model.SupportsCodePreview)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Code Preview", Key = "preview"
                    });
                }

                content.AddRow(new Label {
                    Text = "Form:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center
                }, panelTypeList);
            }

            if (model.SupportsBase)
            {
                var baseTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Horizontal,
                    Spacing     = new Size(0, 0),
                };

                baseTypeList.Items.Add(new ListItem {
                    Text = "Panel", Key = "Panel"
                });
                baseTypeList.Items.Add(new ListItem {
                    Text = "Dialog", Key = "Dialog"
                });
                baseTypeList.Items.Add(new ListItem {
                    Text = "Form", Key = "Form"
                });
                baseTypeList.SelectedKeyBinding.BindDataContext((ProjectWizardPageModel m) => m.Base);

                content.AddRow(new Label {
                    Text = "Base:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center
                }, baseTypeList);
            }

            var informationLabel = new Label();

            informationLabel.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.Information);
            Information = informationLabel;

            Content     = content;
            DataContext = model;
        }
예제 #9
0
        public ProjectWizardPageView(ProjectWizardPageModel model)
        {
            var radioSpacing = Platform.IsGtk ? Size.Empty : new Size(2, 2);

            var content = new DynamicLayout
            {
                Spacing = new Size(10, 10)
            };

            if (model.SupportsAppName)
            {
                var nameBox = new TextBox();
                nameBox.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.AppName);
                Application.Instance.AsyncInvoke(nameBox.Focus);

                var nameValid = new Label {
                    TextColor = Global.Theme.ErrorForeground
                };
                nameValid.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AppNameInvalid);
                nameValid.BindDataContext(c => c.Text, (ProjectWizardPageModel m) => m.AppNameValidationText);


                content.BeginHorizontal();
                content.Add(HeadingLabel((model.IsLibrary ? "Library" : "App") + " Name:"));
                content.AddColumn(nameBox, nameValid);
                content.EndHorizontal();
            }
            else if (!string.IsNullOrEmpty(model.AppName))
            {
                var label = new Label {
                    Text = model.AppName, VerticalAlignment = VerticalAlignment.Center
                };
                content.AddRow(HeadingLabel((model.IsLibrary ? "Library" : "App") + " Name:"), label);
            }

            if (model.SupportsFramework)
            {
                var frameworkDropDown = new DropDown();
                frameworkDropDown.BindDataContext(c => c.DataStore, (ProjectWizardPageModel m) => m.SupportedFrameworks);
                frameworkDropDown.ItemTextBinding = Binding.Property((ProjectWizardPageModel.FrameworkInfo i) => i.Text);
                frameworkDropDown.ItemKeyBinding  = Binding.Property((ProjectWizardPageModel.FrameworkInfo i) => i.Value);
                frameworkDropDown.SelectedValueBinding.BindDataContext((ProjectWizardPageModel m) => m.SelectedFramework);

                /*
                 * var frameworkCheckBoxes = new CheckBoxList();
                 * frameworkCheckBoxes.BindDataContext(c => c.DataStore, (ProjectWizardPageModel m) => m.SupportedFrameworks);
                 * frameworkCheckBoxes.ItemTextBinding = Binding.Property((ProjectWizardPageModel.FrameworkInfo i) => i.Text);
                 * frameworkCheckBoxes.ItemKeyBinding = Binding.Property((ProjectWizardPageModel.FrameworkInfo i) => i.Value);
                 * frameworkCheckBoxes.SelectedValuesBinding.BindDataContext((ProjectWizardPageModel m) => m.SelectedFrameworks);
                 */

                content.AddRow(HeadingLabel("Framework:"), frameworkDropDown);
            }

            if (model.SupportsCombined)
            {
                var platformTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Vertical,
                    Spacing     = radioSpacing,
                    Items       =
                    {
                        new ListItem {
                            Text = "Separate projects for each platform", Key = "separate"
                        },
                        new ListItem {
                            Text = "Single Windows, Linux, and Mac desktop project", Key = "combined"
                        }
                    }
                };
                platformTypeList.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AllowCombined);
                platformTypeList.SelectedKeyBinding
                .Convert(v => v == "combined", v => v ? "combined" : "separate")
                .BindDataContext((ProjectWizardPageModel m) => m.Combined);
                var heading = HeadingLabel("Launcher:");
                heading.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AllowCombined);
                content.AddRow(heading, platformTypeList);
            }

            if (model.SupportsXamMac)
            {
                var cb = new CheckBox
                {
                    Text    = "Include Xamarin.Mac project",
                    ToolTip = "This enables you to bundle mono with your app so your users don't have to install it separately.  You can only compile this on a Mac"
                };
                cb.CheckedBinding.BindDataContext((ProjectWizardPageModel m) => m.IncludeXamMac);
                content.AddRow(HeadingLabel(string.Empty), cb);
            }

            /*
             * eventually select platforms to include?
             *
             * var platformCheckBoxes = new DynamicLayout();
             * platformCheckBoxes.BeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "Gtk2" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Gtk3" });
             * platformCheckBoxes.EndBeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "WinForms" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Wpf" });
             * platformCheckBoxes.Add(new CheckBox { Text = "Direct2D" });
             * platformCheckBoxes.EndBeginHorizontal();
             * platformCheckBoxes.Add(new CheckBox { Text = "Mac" });
             * platformCheckBoxes.Add(new CheckBox { Text = "XamMac" });
             * platformCheckBoxes.Add(new CheckBox { Text = "XamMac2" });
             * platformCheckBoxes.EndHorizontal();
             *
             * content.Rows.Add(new TableRow(new Label { Text = "Platforms:", TextAlignment = TextAlignment.Right }, platformCheckBoxes));
             * /**/

            if (model.SupportsProjectType)
            {
                var sharedCodeList = new RadioButtonList
                {
                    Orientation = Orientation.Vertical,
                    Spacing     = radioSpacing,
                };
                if (model.SupportsPCL)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = "Portable Class Library", Key = "pcl"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "pcl", v => v ? "pcl" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UsePCL);
                }
                if (model.SupportsNetStandard)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = ".NET Standard", Key = "netstandard"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "netstandard", v => v ? "netstandard" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseNetStandard);
                }
                if (model.SupportsSAL)
                {
                    sharedCodeList.Items.Add(new ListItem {
                        Text = "Shared Project", Key = "sal"
                    });
                    sharedCodeList.SelectedKeyBinding.Convert(v => v == "sal", v => v ? "sal" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseSAL);
                }

                sharedCodeList.Items.Add(new ListItem {
                    Text = "Full .NET", Key = "net"
                });
                sharedCodeList.SelectedKeyBinding.Convert(v => v == "net", v => v ? "net" : sharedCodeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseNET);

                content.AddRow(new Label {
                    Text = model.IsLibrary ? "Type:" : "Shared Code:", TextAlignment = TextAlignment.Right
                }, sharedCodeList);
            }

            if (model.SupportsPanelType)
            {
                var panelTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Horizontal,
                    Spacing     = radioSpacing,
                };

                panelTypeList.Items.Add(new ListItem {
                    Text = "Code", Key = "code"
                });
                panelTypeList.SelectedKeyBinding.BindDataContext((ProjectWizardPageModel m) => m.Mode);

                if (model.SupportsXeto)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Xaml", Key = "xaml"
                    });
                }
                if (model.SupportsJeto)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Json", Key = "json"
                    });
                }
                if (model.SupportsCodePreview)
                {
                    panelTypeList.Items.Add(new ListItem {
                        Text = "Code Preview", Key = "preview"
                    });
                }

                content.AddRow(HeadingLabel("Form:"), panelTypeList);
            }

            if (model.SupportsBase)
            {
                var baseTypeList = new RadioButtonList
                {
                    Orientation = Orientation.Horizontal,
                    Spacing     = radioSpacing,
                };

                baseTypeList.Items.Add(new ListItem {
                    Text = "Panel", Key = "Panel"
                });
                baseTypeList.Items.Add(new ListItem {
                    Text = "Dialog", Key = "Dialog"
                });
                baseTypeList.Items.Add(new ListItem {
                    Text = "Form", Key = "Form"
                });
                baseTypeList.SelectedKeyBinding.BindDataContext((ProjectWizardPageModel m) => m.Base);

                content.AddRow(HeadingLabel("Base:"), baseTypeList);
            }

#if DEBUG
            //var showColorsButton = new Button { Text = "Show all themed colors" };
            //showColorsButton.Click += (sender, e) => new ThemedColorsDialog().ShowModal(this);
            //content.AddRow(new Panel(), showColorsButton);
#endif

            var informationLabel = new Label();
            informationLabel.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.Information);
            Information = informationLabel;

            Content     = content;
            DataContext = model;
        }