public ProjectWizardPage(ProjectWizard wizard) { this.Wizard = wizard; var source = new ParameterSource(wizard); source.ParameterChanged += (name, value) => { if (name == "AppName") { source.SetParameter("ProjectName", value); Validate(); } }; this.model = new ProjectWizardPageModel(source, null); Validate(); }
public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { base.RunStarted(automationObject, replacementsDictionary, runKind, customParams); var source = new ParameterSource(replacementsDictionary); var model = new ProjectWizardPageModel(source); model.AppName = replacementsDictionary["$projectname$"]; if (model.RequiresInput) { var panel = new ProjectWizardPageView(model); var dialog = new BaseDialog { Content = panel, Title = model.Title }; if (!dialog.ShowModal(Helpers.MainWindow)) throw new WizardBackoutException(); } }
public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { base.RunStarted(automationObject, replacementsDictionary, runKind, customParams); var source = new ParameterSource(replacementsDictionary); var doc = Helpers.LoadWizardXml(replacementsDictionary); var ns = Helpers.WizardNamespace; var model = new ProjectWizardPageModel(source, doc.Root.Elements(ns + "Options").FirstOrDefault()); model.AppName = replacementsDictionary["$projectname$"]; if (model.RequiresInput) { var panel = new ProjectWizardPageView(model); var dialog = new BaseDialog { Content = panel, Title = model.Title, ClientSize = new Size(-1, 400) }; if (!dialog.ShowModal(Helpers.MainWindow)) throw new WizardBackoutException(); } }
public ProjectWizardPageView(ProjectWizardPageModel model) { var content = new TableLayout { Spacing = new Size(10, 10) }; if (model.ShowAppName) { var nameBox = new TextBox(); nameBox.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.AppName); Application.Instance.AsyncInvoke(nameBox.Focus); content.Rows.Add(new TableRow(new Label { Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }, nameBox)); } else if (!string.IsNullOrEmpty(model.AppName)) { var label = new Label { Text = model.AppName, VerticalAlignment = VerticalAlignment.Center }; content.Rows.Add(new TableRow(new Label { Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }, label)); } if (model.SupportsCombined) { var platformTypeList = new RadioButtonList { Orientation = Orientation.Vertical, Spacing = new Size(0, 0), Items = { new ListItem { Text = "Combined Windows && Linux assembly, separate Mac", Key = "combined" }, new ListItem { Text = "Separate platform assemblies", Key = "separate" } } }; platformTypeList.SelectedKeyBinding.Convert(v => v == "combined", v => v ? "combined" : "separate").BindDataContext((ProjectWizardPageModel m) => m.Combined); content.Rows.Add(new TableRow(new Label { Text = "Launcher:", TextAlignment = TextAlignment.Right }, platformTypeList)); } /* * 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.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.Rows.Add(new TableRow(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.Convert(v => v == "code", v => v ? "code" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseCode); if (model.SupportsXeto) { panelTypeList.Items.Add(new ListItem { Text = "Xaml", Key = "xaml" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "xaml", v => v ? "xaml" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseXeto); } if (model.SupportsJeto) { panelTypeList.Items.Add(new ListItem { Text = "Json", Key = "json" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "json", v => v ? "json" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseJeto); } if (model.SupportsCodePreview) { panelTypeList.Items.Add(new ListItem { Text = "Code Preview", Key = "codePreview" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "codePreview", v => v ? "codePreview" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseCodePreview); } content.Rows.Add(new TableRow(new Label { Text = "Form:", TextAlignment = TextAlignment.Right }, panelTypeList)); } var informationLabel = new Label(); informationLabel.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.Information); Information = informationLabel; Content = content; DataContext = model; }
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; }
public ProjectWizardPageView(ProjectWizardPageModel model) { var content = new TableLayout { Spacing = new Size(10, 10) }; if (model.ShowAppName) { var nameBox = new TextBox(); nameBox.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.AppName); Application.Instance.AsyncInvoke(nameBox.Focus); content.Rows.Add(new TableRow(new Label { Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }, nameBox)); } else if (!string.IsNullOrEmpty(model.AppName)) { var label = new Label { Text = model.AppName, VerticalAlignment = VerticalAlignment.Center }; content.Rows.Add(new TableRow(new Label { Text = (model.IsLibrary ? "Library" : "App") + " Name:", TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }, label)); } if (model.SupportsCombined) { var platformTypeList = new RadioButtonList { Orientation = Orientation.Vertical, Spacing = new Size(0, 0), Items = { new ListItem { Text = "Combined Windows && Linux assembly, separate Mac", Key = "combined" }, new ListItem { Text = "Separate platform assemblies", Key = "separate" } } }; platformTypeList.SelectedKeyBinding.Convert(v => v == "combined", v => v ? "combined" : "separate").BindDataContext((ProjectWizardPageModel m) => m.Combined); content.Rows.Add(new TableRow(new Label { Text = "Launcher:", TextAlignment = TextAlignment.Right }, platformTypeList)); } /* * 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.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.Rows.Add(new TableRow(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.Convert(v => v == "code", v => v ? "code" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseCode); if (model.SupportsXeto) { panelTypeList.Items.Add(new ListItem { Text = "Xaml", Key = "xaml" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "xaml", v => v ? "xaml" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseXeto); } if (model.SupportsJeto) { panelTypeList.Items.Add(new ListItem { Text = "Json", Key = "json" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "json", v => v ? "json" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseJeto); } if (model.SupportsCodePreview) { panelTypeList.Items.Add(new ListItem { Text = "Code Preview", Key = "codePreview" }); panelTypeList.SelectedKeyBinding.Convert(v => v == "codePreview", v => v ? "codePreview" : panelTypeList.SelectedKey).BindDataContext((ProjectWizardPageModel m) => m.UseCodePreview); } content.Rows.Add(new TableRow(new Label { Text = "Form:", TextAlignment = TextAlignment.Right }, panelTypeList)); } var informationLabel = new Label(); informationLabel.TextBinding.BindDataContext((ProjectWizardPageModel m) => m.Information); Information = informationLabel; Content = content; DataContext = model; }
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; }