Finally, I was able to take out the X-axis label, but I couldn't implement a null converter in SL3, because like you said TargetNullValue is available in SL4.
Could you explain to me how to do it?
public sealed class MyDictionaryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var dict = value as IDictionary<string, object>;
if (dict != null)
{
if (dict.ContainsKey(parameter as string))
return dict[parameter as string];
}
return 0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
What Should I refresh after it?
private void ckbVisibility_Checked(object sender, RoutedEventArgs e)
{
CheckBox ckb = sender as CheckBox;
TocItem data = ckb.DataContext as TocItem;
if (ckb.Tag.ToString().ToLower() == "new")
{
ckb.Tag = "";
data.ItemChecked += _itemChecked;
}
}
Binding b2 = new Binding("");
MyDictionaryConverter dc2 = new MyDictionaryConverter();
b2.Converter = dc2;
Is possible to insert a combobox inside a cell of a DataGrid?,
<esri:FeatureLayer.MapTip>
<Border Background="Pink">
<Border.Resources>
<sys:Int32 x:Key="zero">0</sys:Int32>
<ListBox x:Name="_1998">
<ListBoxItem Content="{Binding [tcmlatestcounts._1998], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_1999">
<ListBoxItem Content="{Binding [tcmlatestcounts._1999], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2000">
<ListBoxItem Content="{Binding [tcmlatestcounts._2000], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2001">
<ListBoxItem Content="{Binding [tcmlatestcounts._2001], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2002">
<ListBoxItem Content="{Binding [tcmlatestcounts._2002], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2003">
<ListBoxItem Content="{Binding [tcmlatestcounts._2003], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2004">
<ListBoxItem Content="{Binding [tcmlatestcounts._2004], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2005">
<ListBoxItem Content="{Binding [tcmlatestcounts._2005], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2006">
<ListBoxItem Content="{Binding [tcmlatestcounts._2006], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2007">
<ListBoxItem Content="{Binding [tcmlatestcounts._2007], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2008">
<ListBoxItem Content="{Binding [tcmlatestcounts._2008], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2009">
<ListBoxItem Content="{Binding [tcmlatestcounts._2009], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="_2010">
<ListBoxItem Content="{Binding [tcmlatestcounts._2010], TargetNullValue={StaticResource zero}}" />
</ListBox>
</Border.Resources>
<!--<TextBlock Text="{Binding [tcmlatestcounts._1998]}" Foreground="Black" />-->
<toolkit:Chart Title="Historical Counts" Width="800">
<toolkit:Chart.Axes>
<toolkit:CategoryAxis Orientation="X" Foreground="Transparent" />
</toolkit:Chart.Axes>
<toolkit:Chart.Series>
<toolkit:ColumnSeries Title="1998" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _1998}, Path=Items}" />
<toolkit:ColumnSeries Title="1999" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _1999}, Path=Items}" />
<toolkit:ColumnSeries Title="2000" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2000}, Path=Items}" />
<toolkit:ColumnSeries Title="2001" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2001}, Path=Items}" />
<toolkit:ColumnSeries Title="2002" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2002}, Path=Items}" />
<toolkit:ColumnSeries Title="2003" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2003}, Path=Items}" />
<toolkit:ColumnSeries Title="2004" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2004}, Path=Items}" />
<toolkit:ColumnSeries Title="2005" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2005}, Path=Items}" />
<toolkit:ColumnSeries Title="2006" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2006}, Path=Items}" />
<toolkit:ColumnSeries Title="2007" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2007}, Path=Items}" />
<toolkit:ColumnSeries Title="2008" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2008}, Path=Items}" />
<toolkit:ColumnSeries Title="2009" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2009}, Path=Items}" />
<toolkit:ColumnSeries Title="2010" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2010}, Path=Items}" />
</toolkit:Chart.Series>
</toolkit:Chart>
</Border>
</esri:FeatureLayer.MapTip> <esri:FeatureLayer.MapTip>
<Border Style="{StaticResource PanelBorder}">
<Border.Resources>
<sys:Int32 x:Key="zero">0</sys:Int32>
<ListBox x:Name="Counts">
<ListBoxItem Name="_1998" Content="{Binding [tcmlatestcounts._1998], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_1999" Content="{Binding [tcmlatestcounts._1999], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2000" Content="{Binding [tcmlatestcounts._2000], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2001" Content="{Binding [tcmlatestcounts._2001], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2002" Content="{Binding [tcmlatestcounts._2002], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2003" Content="{Binding [tcmlatestcounts._2003], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2004" Content="{Binding [tcmlatestcounts._2004], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2005" Content="{Binding [tcmlatestcounts._2005], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2006" Content="{Binding [tcmlatestcounts._2006], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2007" Content="{Binding [tcmlatestcounts._2007], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2008" Content="{Binding [tcmlatestcounts._2008], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2009" Content="{Binding [tcmlatestcounts._2009], TargetNullValue={StaticResource zero}}" />
<ListBoxItem Name="_2010" Content="{Binding [tcmlatestcounts._2010], TargetNullValue={StaticResource zero}}" />
</ListBox>
</Border.Resources>
<toolkit:Chart Title="Historical Counts" FontWeight="Bold" Width="800" Height="400">
<toolkit:Chart.Axes>
<toolkit:CategoryAxis Orientation="X" Title="Year" />
<toolkit:CategoryAxis Orientation="Y" Title="ADT" />
</toolkit:Chart.Axes>
<toolkit:Chart.Series>
<toolkit:ColumnSeries Title="ADT" IndependentValueBinding="{Binding Name}" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource Counts}, Path=Items}" />
</toolkit:Chart.Series>
</toolkit:Chart>
</Border>
</esri:FeatureLayer.MapTip>