I have a rather odd question but I somehow hope that it is possible. But after reading a lot I'm rather pessimistic about it.
That's why I'm asking the question here now.
I have some Lists/OberservableCollections that I create by reading from my serial port. Now I have a debug screen in my app where I just display the content of those lists. So far so good. It's working nicely.
Now I have a settings/control page where I want to use the data to produce a control page. For that I need to use the different data streams in recieve and build controls for that.
The streams I get are as following:
- Parameternames
- Minimum and maximum values
- Current values on device
- In which unit the parameter is measured (if it has a definition for it)
I created a quick example on how I want it to look like:
The first stream will be the first column of the view. The second stream is used to decide the minimum and maximum values of the slider or if I even need a slider or something else. Then I have the third stream to set the current values of the sliders/controls. and the last stream is used to add the unit description at the end of the row.
Is it possible to somehow create the controls after I read the streams without creating them in the code behind file? I don't start the reading operations from my view so I can't use the code behind file directly. Maybe I can invoke a function in my code behind file from somewhere else? Or should I implement an event for this? (never done that)
The only option I can think about is to create all the elements in the xaml and control their visibility with bindings but that would be totally unreasonable since I will have around 100 rows of parameters...
I'm really a bit helpless here :/
Best regards, Daniel