Binding reference question

Nov 19, 2009 at 1:27 PM

I'm coding a style that combines a progressbar with text and will be used within a datagrid column. In the control template I need to access the bound value in order to convert it to text as well as to set the StringFormat (later I need the value in a datatrigger to determine the color of the bar based on % completed). Since this can be reused, I don't want to code the Path= binding reference to a specific field, but would rather access the value that the control is bound to. I'm having a hard time with how to reference that. Below are two of the bindings I'm using, but they have a Path= statement. I basically want to use whatever binding that the control was setup with and pass it to my converter or add additional parameters to the binding (ie Mode=OneWay and StringFormat=P2). Been search for  a solution for some time now.





Value="{Binding Path=Pct_change, Converter={StaticResource pctConverter}, Mode=OneWay}"



Text="{Binding Path=Pct_change,