Hello everyone,
I'm having some problems with WPF binding.
I have an assembly with some const properties in class Values, that correspond to columns from datatable.
I want to bind the value from a column to a TextBlock using the const property to specify the column at a ListView ItemTemplate like shown in the code:
xmlns:C="clr-namespace:WPFApplication1.Entities;assembly=WPFApplication1">
<Grid>
<ListView>
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding {x:Static C:Values.FieldCode}}" /> /*<- Don't work*/
/*Works like this: <TextBlock Text="{Binding [CODE]}" />*/
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
If I use binding with the static property I I'm not able to show the value in the datarow but if I use the Binding like this [CODE] I'm able to show the value.
What is appening? Any clue?
Thanks in advance.