Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,

I want to allow a user to input data in two different ways so he could choose a more comfortable one. I have designed a TabControl, where each TabItem presents a GUI to input data in a different form.

My current goal is to keep them in sync and be able to access the input in a common format from code.

Eg:

method 1: text-mode, a single text box
method 2: a number of labeled textboxes

in code:
C#
var data = viewModel.Input; // whatever input mode was choosen by a user, this contains a coding-friendly data.


Should I create two user controls which both expose the same property and implement converters or there is a better (or more preferable) way?

Greetings,
Jacek
Posted
Comments
Dean Oliver 20-Mar-12 7:25am    
have you thought of using a frame.
Wayne Gaylard 20-Mar-12 7:36am    
Could you give a better idea of what sort of input is being received. You say that with method 1 the user can enter all the data in one text box, while with method 2 they can use multiple text boxes. Does this mean that viewModel.Input is a string or array/List of strings, or some other datatype.

1 solution

Not sure, but maybe a ValueConverter can help?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900