diff --git a/src/SwitchifyPc.App/SwitchControlProfileWindow.xaml.cs b/src/SwitchifyPc.App/SwitchControlProfileWindow.xaml.cs index fd508cf..56d3b02 100644 --- a/src/SwitchifyPc.App/SwitchControlProfileWindow.xaml.cs +++ b/src/SwitchifyPc.App/SwitchControlProfileWindow.xaml.cs @@ -472,11 +472,17 @@ private sealed record ProfileListItem( private sealed record BindingTypeOption( SwitchBindingType Value, - string Label); + string Label) + { + public override string ToString() => Label; + } private sealed record BindingValueOption( string Value, - string Label); + string Label) + { + public override string ToString() => Label; + } private sealed class BindingRowViewModel : INotifyPropertyChanged { diff --git a/src/SwitchifyPc.Tests/SwitchControlProfileWindowTests.cs b/src/SwitchifyPc.Tests/SwitchControlProfileWindowTests.cs index 7bd88fb..db0ee81 100644 --- a/src/SwitchifyPc.Tests/SwitchControlProfileWindowTests.cs +++ b/src/SwitchifyPc.Tests/SwitchControlProfileWindowTests.cs @@ -307,6 +307,8 @@ public void ProfileWindowUsesFriendlyLabelsAndSavesCanonicalValues() Assert.Contains("Mouse button", ItemLabels(action)); Assert.Contains("Media control", ItemLabels(action)); + Assert.Equal("Keyboard key", action.SelectionBoxItem.ToString()); + Assert.Contains("Up arrow", value.Items.Cast().Select(item => item.ToString())); action.SelectedValue = SwitchBindingType.MouseClick; Assert.Empty(value.Text); Assert.False(save.IsEnabled);