views:

230

answers:

2

So many dead ends!

I'm trying to achieve two way binding between a visualization and an array of about 300 single bytes of data.

It sounds simple but it turns out not.

Even Bea Stollnitz, it seems, took three goes at binding a polyline to data: Part 1 Part 2 Part 3

What hope does a beginner have?

So my question is:

Is there a series of systematic questions you ask yourself which helps avoiding dead ends and wasted time when coming up with a binding strategy in WPF?

(Or is there a link to a concise document/matrix that tells you what you need to implement in order to reach the cheese?)

+1  A: 

For starters, the MSDN data-binding overview is really helpful. It gives you diagrams, code examples, implementation details- the whole nine yards. It is truly exhaustive but if you spend an hour or two poring over it you will leave with a much better idea of what is happening.

Also, this tutorial from core.net is more concise but very helpful in that it is approach-based. He basically breaks down data-binding from three approaches:

  1. Typical
  2. C# Only
  3. C# and XAML
Charlie
A: 

IValueConverter is your probably your best friend. You can use it for all kinds of data conversion, from and to your binding source!

So bind to your data and use a IValueConverter implementation to do your conversion stuff!

Arcturus