0

I have a ComboBox in my application that should have these values in the dropdown: Y+ Y- X+ Y- Z+ Z-

Right now, the code that does this, is:

<ComboBox Grid.Column="1">
    <ComboBoxItem x:Name="FwdDirXpos"> X+ </ComboBoxItem>
    <ComboBoxItem x:Name="FwdDirXneg"> X- </ComboBoxItem>
    <ComboBoxItem x:Name="FwdDirYpos"> Y+ </ComboBoxItem>
    <ComboBoxItem x:Name="FwdDirYneg"> Y- </ComboBoxItem>
    <ComboBoxItem x:Name="FwdDirZpos"> X+ </ComboBoxItem>
    <ComboBoxItem x:Name="FwdDirZneg"> X- </ComboBoxItem>
</ComboBox>

The selection of this ComboBox should be bound to a public property on the model, defined as:

Public Property modelOrientationFWD As Utilities.Enums.principalDirections

And that enum is defined as:

Public Enum principalDirections
    Xpos
    Xneg
    Zpos
    Zneg
    Zpos
    Zneg
End Enum

Ideally, it would be nice if the ComboBox was automatically populated from the Enum (like via ObjectDataProvider), but since the values in the ComboBox need to be like "Y+" (with special symbol), it probably won't work. That is fine - more importantly, I want to bind the selection of ComboBox two-way to the modelOrientationFWD property.

As I understand, this needs some kind of converter, correct? I've written converters in the past, but I have no clue on how to proceed in this specific case.

0 Answers0