Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ public override object Convert(object value, [NotNull] Type targetType, object p
var frameworkFolder = (string)value;

var framework = NuGetFramework.ParseFolder(frameworkFolder);
if (framework.Framework == ".NETFramework")
return $".NET {framework.Version.ToString(3)}";
else if (framework.Framework == ".NETCoreApp")
return $".NET Core {framework.Version.ToString(2)}";
if (framework.Framework == ".NETCoreApp")
return $".NET {framework.Version.ToString(2)}";
Comment on lines -16 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required for older versions that supported multiple frameworks.


// fallback
return $"{framework.Framework} {framework.Version.ToString(3)}";
Expand Down
2 changes: 1 addition & 1 deletion sources/launcher/Stride.Launcher/Views/LauncherWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
</i:Interaction.Behaviors>
</Button>
</Grid>
<ComboBox Margin="0,4" Name="FrameworkSelector" IsEnabled="{Binding ActiveVersion.Frameworks.Count, Converter={sskk:Chained {sskk:IsGreater}, Parameter1={sskk:Double 1}}}" ItemsSource="{Binding ActiveVersion.Frameworks}" SelectedItem="{Binding ActiveVersion.SelectedFramework}" SelectionChanged="FrameworkChanged">
<ComboBox Margin="0,4" Name="FrameworkSelector" IsEnabled="{Binding ActiveVersion.Frameworks.Count, Converter={sskk:Chained {sskk:IsGreater}, Parameter1={sskk:Double 0}}}" ItemsSource="{Binding ActiveVersion.Frameworks}" SelectedItem="{Binding ActiveVersion.SelectedFramework}" SelectionChanged="FrameworkChanged">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's kind of a useless check since it can never be negative. The reason it was greyed out was because there is no need to select anything when only one framework is available.

I'd rather not display anything in that case, i.e. change IsEnabled to IsVisible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we display plain text (in white) when there's only one item? It would still be helpful to show the .NET version so that those unfamiliar with Stride can see it.

The behavior would remain the same when multiple items are available, but if there's only one item, the combo box wouldn't be displayed, just plain white text instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also a good option.

<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={vm:FrameworkConverter}}" />
Expand Down