Dominique,
I have a problem trying to update the binding by code inside a FeatureLayer. For example I have this Feature Layer in the XAML:
<esri:FeatureLayer ID="ChartFLayer" x:Name="ChartFL"
FeatureSymbol="{StaticResource ProductionMarkerSymbol}">
<esri:FeatureLayer.OutFields>
<sys:String>PROD_ACUM</sys:String>
</esri:FeatureLayer.OutFields>
<esri:FeatureLayer.MapTip>
<Border Style="{StaticResource MapTipBorder}">
<Grid Height="160" Width="160">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<TextBlock Margin="5,0,0,0" Text= "Prod: " Foreground="White"/>
<TextBlock Margin="25,0,0,0" x:Name="txtProd" Foreground="White" Text="{Binding Converter={StaticResource MyDictionaryConverter},ConverterParameter=PROD_ACUM, Mode=OneWay}" />
</Grid>
</Border>
</esri:FeatureLayer.MapTip>
</esri:FeatureLayer>
I want to update by code the ConverterParameter PROD_ACUM in txtProd, but I cant!
First problem:
txtProd is null when I try to add a binding by code.
Second Problem:
If I try creating a new TextBlock instance and changing the binding like this code below, it doesn't work:
FeatureLayer ChartFeaturelayer = MyMap.Layers["ChartFL"] as FeatureLayer;
ChartFeaturelayer.OutFields.Add("NEWFIELD"]);
txtIDChart = new TextBlock();
Binding b = new Binding("");
b.Mode = BindingMode.OneWay;
b.ConverterParameter = "NEWFIELD";
txtIDChart.SetBinding(TextBlock.TextProperty, b);
txtIDChart.UpdateLayout();
Thanks in advance.
Emiliano.