I've got user-definable columns for my data grid, which basically boils down to a
switch(column_title)
{
case "foo": binding = new Binding("Model.Fonz");
//etc.
}
and the binding gets applied to the column.
Now I need to dump to csv, with the configured columns. As it may be a different column set that being used in my ui and I definitely don't want two huge switch statements to maintain, I'd essentially like a function like this:
object GetBoundProperty(object o, System.Windows.Data.Binding binding)
I won't be surprised if its obnoxiously easy, but its outside the range of my .NET knowledge at the moment and I have little desire to parse the periods out of the binding and search through reflection unless I totally have to. Thanks!