Skip to content

Commit

Permalink
Merge pull request #1861 from cwensley/curtis/project-template-framew…
Browse files Browse the repository at this point in the history
…orks

Update framework selection for addins and template
  • Loading branch information
cwensley authored Dec 31, 2020
2 parents 58fe8d5 + 5f7b416 commit 0c7b34b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 24 deletions.
4 changes: 3 additions & 1 deletion src/Addins/Eto.Addin.Shared/ProjectWizardPageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public class FrameworkInfo
{
new FrameworkInfo { Text = ".NET 5", Value = "net5.0", CanUseCombined = false },
new FrameworkInfo { Text = ".NET Core 3.1", Value = "netcoreapp3.1", CanUseCombined = false },
new FrameworkInfo { Text = ".NET Framework 4.7.2 / Mono", Value = "net472", CanUseCombined = true },
new FrameworkInfo { Text = ".NET Framework 4.8", Value = "net48", CanUseCombined = true },
new FrameworkInfo { Text = ".NET Framework 4.7.2", Value = "net472", CanUseCombined = true },
new FrameworkInfo { Text = ".NET Framework 4.6.2", Value = "net462", CanUseCombined = true },
};

FrameworkInfo _selectedFramework;
Expand Down
44 changes: 23 additions & 21 deletions src/Addins/Eto.Addin.Shared/ProjectWizardPageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@ public ProjectWizardPageView(ProjectWizardPageModel model)
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
Expand All @@ -57,11 +76,13 @@ public ProjectWizardPageView(ProjectWizardPageModel model)
new ListItem { Text = "Single Windows, Linux, and Mac desktop project", Key = "combined" }
}
};
platformTypeList.BindDataContext(c => c.Enabled, (ProjectWizardPageModel m) => m.AllowCombined);
platformTypeList.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AllowCombined);
platformTypeList.SelectedKeyBinding
.Convert(v => v == "combined", v => v ? "combined" : "separate")
.BindDataContext((ProjectWizardPageModel m) => m.Combined);
content.AddRow(HeadingLabel("Launcher:"), platformTypeList);
var heading = HeadingLabel("Launcher:");
heading.BindDataContext(c => c.Visible, (ProjectWizardPageModel m) => m.AllowCombined);
content.AddRow(heading, platformTypeList);
}

if (model.SupportsXamMac)
Expand Down Expand Up @@ -95,25 +116,6 @@ public ProjectWizardPageView(ProjectWizardPageModel model)
content.Rows.Add(new TableRow(new Label { Text = "Platforms:", TextAlignment = TextAlignment.Right }, platformCheckBoxes));
/**/

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.SupportsProjectType)
{
var sharedCodeList = new RadioButtonList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@
"choice": "netcoreapp3.1",
"description": ".NET Core 3.1"
},
{
"choice": "net48",
"description": ".NET Framework 4.8"
},
{
"choice": "net472",
"description": ".NET Framework 4.7.2"
},
{
"choice": "net462",
"description": ".NET Framework 4.6.2 / Mono"
"description": ".NET Framework 4.6.2"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,17 @@
"choice": "netcoreapp3.1",
"description": ".NET Core 3.1"
},
{
"choice": "net48",
"description": ".NET Framework 4.8"
},
{
"choice": "net472",
"description": ".NET Framework 4.7.2"
},
{
"choice": "net462",
"description": ".NET Framework 4.6.2 / Mono"
"description": ".NET Framework 4.6.2"
}
]
},
Expand Down

0 comments on commit 0c7b34b

Please sign in to comment.