none
Using a combo box with Prism

    Question

  • I have a class that holds parameters for a Communication Connection. The protocol field property can be either serial or tcpip. In the class I have a CommProtocol property with an enum to select either serial or tcpip. Now in the region I am displaying a form to enter the information for the Communication Connection. I want to use a combobox so the user can select either serial or tcpip. I can't figure out how to construct my view model so I can store the enum integer but display the type as a string. I tried creating a class (Protocol) with just an id field and protocolname field to hold this information. I create a list of the protocol class using the property Protocols in my view model. But when I try to bind selectedvaluepath and displaymemberpath to the individual id and protocolname I see errors that the properties aren't found. Of course as they aren't properties of the view model.

    Any ideas would be appreciated. Thanks.

    Friday, March 19, 2010 1:09 PM

Answers

  • I dont think there is a need to set the displayvalue and such fields.Just bind to the wrapper class collection and get the selected item.

    for display purpose use the datatemplate mechanism

    Monday, March 22, 2010 1:52 PM