|
-
Aug 22nd, 2013, 11:51 AM
#1
Re: Help getting started with DataRepeater
Three of the properties are simple text strings. The fourth is a ProgressBar.
Huh? How can a ProgressBar be a property?
Firstly, can/should dictionaries be bound to DataRepeaters?
Well, you've done the experiments. You tell us! The question I'm asking myself however, is why you're using a dictionary at all. It appears that you need nothing more or less than a List(Of DeviceUnderTest) and that definitely can be bound to a DataRepeater (or any other binding capable control).
Secondly, if a dictionary is bound to a GUI control will accessing the properties of one of the dictionary's values require invocation? i.e. will the dictionary be tied to the GUI thread?
This really doesn't make any sense, even as a question. Invocation applies to controls on the UI thread. Since neither the Dictionary nor the Object in question appear to be controls, I have no idea how it could possible apply.
Thirdly, and most importantly, how should the view be updated when an object is added or removed from the dictionary? From my exceedingly limited understanding of binding, this should happen automatically, yet in my trials so far it is not.
There's binding and then there's binding. Not all bindings auto-update but I confess it's so long since I even looked at the DataRepeater that I can't tell you whether this is one of them (I might have a play in a minute). I suspect that you have other issues to sort out before you worry about that though.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Aug 22nd, 2013, 12:19 PM
#2
Thread Starter
Hyperactive Member
Re: Help getting started with DataRepeater
Hi Dunfiddlin
Thanks for your reply. apologies, I realise I wasn't too clear on some things 
As regards the PogressBar I meant that the fourth item in the DataRepeaterItemTemplate is a ProgressBar - The progress level should be set by the Progress property of a DeviceUnderTest value from the dictionary.
The reason I am using a dictionary is that the value objects are acting as contexts for a set of devices I am testing. each device has a set of kind of "independent" threads running tasks for it. The threads know which context they are using by the key. As objects don't need to be removed in any strict order I could not just used the index of a list or array as that would change as objects are added or removed. I suppose I could change to using a list and having the object store a UID, but I kind of thought that was the point of dictionaries? (Im actually asking here )
I have done some experiments and they have, obv, only part way worked. So Im none the wiser. In some places the documentation says that objects to be bound must have the IList interface (or a variation thereof). Though the documentation seems to imply that dictionaries don't have this, it is a collection and collections do... so again, confused. Maybe Im attempting to do something that cannot be done or maybe Im just doing it wrong, I dont know - this is the crux of my question.
I have since tried using a list instead in a test and the same problem is found - what is on the list at bind-time is what is displayed and the display never seems to change regardless of changes to the bound list - so I guess Im just doing it wrong - yet I have found no source of information that suggests other ways of doing this (more on that below).
What I meant about the invocation thing is that the DataRepeater is a control. The object is bound to it. If a thread tries to change a property of the bound object is it by proxy changing the control and will such an action thus require invocation?
My own attempts to get this working or find out any further info on the net have been frustrating. Nearly every web page I could find on this either uses very simple examples of binding to a database datasource, or does nearly the same in ASP or C# where it seems that the DataRepeater and binding to it is sufficiently different to confound me in this matter.
Without already having this knowledge its hard to know what more to look for or how to search more directly fro the information I need.
Thanks 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|