Good Morning,
I have a dynamic set of methods which all have the same return type ResultSet. I have the UI to display a ResultSet so what remains is to provide a UI for parameterizing the methods. For example I might have the following methods;
public ResultSet FindNew (DateTime date, int id)
public ResultSet FindOld (DateTime date, int id)
public ResultSet FindMerged (DateTime date, int[] id)
public ResultSet FindNew (DateTime date, string name)
I want to use reflection to provide a drop down of all the methods with the correct return type within a class. Upon selection I would like to generate the input form required to parameterize the method. The user should then be able to submit the query and either see results or be informed of the error that occurred.
I think I can implement this functionality in a naive fashion using my knowledge of C# but I was hoping there may be features of WPF that would help in my quest.
EDIT
Apologies that the question was too broad.
Given an arbitrary
IEnumerableofParameterInfo[]how would you bind to this in your View to create a form such that the user can enter a value for each parameter?
Specifically whilst not breaking MVVM if possible. The issues I can see are;
- Rendering a ParameterInfo into a Label and a data entry component relevant to its type
- Binding the data entry component to something in the ViewModel so that the value can be used
At the moment I'm considering using a custom type or Tuple of the ParameterInfo and the current value for that parameter. Then I could use DataTemplates to show the correct data input component (DatePicker Vs. TextBox Vs. ComboBox).
NB In winforms this was achieved through a PropertyGrid, there is an open source WPF project attempting to achieve the same but I'd rather use my own implementation due to the constraints of the project in terms of dependencies.