Jennifer, Thanks for the reply.
Your binding looks fine to me. But have you looked at this sample? http://www.silverlight.net/content/s...n/default.html I'm not sure which Silverlight toolkit you are using but it seems you have to specify both IndependentValueBinding and DependentValueBinding properties.
The link you provided takes me to the main page (MS Silverlight toolkit). I am basing my work/code straight from the Pie Chart example. Did you want me to look at a different chart example? For the Pie Chart they are not using IndependentValueBinding or at least I didn't see one. I just assumed the IndependentValueBinding and DependentValueBinding were basically the X and Y axis for the charts so the Pie Chart only uses the Dependent and the others (Line, graph, bubbles, Bar, etc) use both variables. Is this the wrong assumption? Do I need to assign the IndependentValueBinding for the PIE. Here's the xaml straght from MS site:
<Grid Style="{StaticResource WrapperStyle}">
<chartingToolkit:Chart Title="AnimationSequence = FirstToLast" Palette="{StaticResource GrowPieDataPointPalette}" Style="{StaticResource ChartStyle}" MouseLeftButtonDown="OnMouseLeftButtonDown">
<chartingToolkit:Chart.Series>
<chartingToolkit:PieSeries ItemsSource="{Binding LevelsInRainfall, Source={StaticResource ParticulateLevel}}" DependentValueBinding="{Binding Particulate}" AnimationSequence="FirstToLast"/>
</chartingToolkit:Chart.Series>
</chartingToolkit:Chart>
</Grid>
Here's my code behind, which I didn't change at all.
# region Pie Chart
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Attached to event handler in XAML.")]
private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Chart chart = sender as Chart;
if (null != chart)
{
// Toggle each Series ItemsSource so the reveal/hide animations can be seen
foreach (DataPointSeries series in chart.Series)
{
if (null == series.Tag)
{
series.Tag = series.ItemsSource;
series.ItemsSource = null;
}
else
{
series.ItemsSource = series.Tag as IEnumerable;
series.Tag = null;
}
}
}
}
#endregion
Here's my xaml, which I also posted in my first post but thought I would post it againg (here) for easier reading
<Grid Style="{StaticResource WrapperStyle}">
<chartingToolkit:Chart Title="AnimationSequence = FirstToLast" Palette="{StaticResource GrowPieDataPointPalette}" Style="{StaticResource ChartStyle}" MouseLeftButtonDown="OnMouseLeftButtonDown" Margin="1,4,-1,-4">
<chartingToolkit:Chart.Series>
<chartingToolkit:PieSeries ItemsSource="{Binding ElementName=Map, Path=Layers[MySelectionGraphicsLayer].Graphics}" DependentValueBinding="{Binding Attributes[DISPDESC]}" AnimationSequence="FirstToLast"/>
</chartingToolkit:Chart.Series>
</chartingToolkit:Chart>
</Grid>
I just threw the code in my app; oh ya and I add the snippets xaml for the visual state / style under my resouces (I'll post that below). Basically if I comment out my code behind and my xaml above (for my grid, which contains my Pie Chart) the app. runs nice and smooth. I can select muiliple police points and my featuretablegrid is always populated and shows up visible but once I uncomment my pie chart grid and code behind the spatial select tool stops firing correctly, only one point will get select no matter how many I try to select and my featuretablegrid visibility(ResultsDisplay.IsExpanded = true) never happens.I'm thinking of maybe it is the order of what is trying to happen. How can I control my Pie Chart not to try and populate until after a selection has been made and after my tablegrid is finished populating?
<Style x:Key="ChartStyle" TargetType="chartingToolkit:Chart">
<Setter Property="Background" Value="Transparent"/>
</Style>
<ControlTemplate x:Key="GrowPieDataPoint" TargetType="chartingToolkit:PieDataPoint">
<Path Data="{TemplateBinding Geometry}" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<ScaleTransform x:Name="Scale" ScaleX="0" ScaleY="0"/>
</Path.RenderTransform>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="RevealStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.5"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Shown">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" To="1" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleY" To="1" Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Hidden">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" To="0" Duration="0"/>
<DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleY" To="0" Duration="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ToolTipService.ToolTip>
<ContentControl Content="{TemplateBinding DependentValue}"/>
</ToolTipService.ToolTip>
</Path>
</ControlTemplate>
<visualizationToolkit:ResourceDictionaryCollection x:Key="GrowPieDataPointPalette">
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Gray"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="DarkBlue"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="DarkRed"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Yellow"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Blue"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Red"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Green"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Pink"/>
</Style>
</ResourceDictionary>
<ResourceDictionary>
<Style x:Key="DataPointStyle" TargetType="chartingToolkit:PieDataPoint">
<Setter Property="Template" Value="{StaticResource GrowPieDataPoint}"/>
<Setter Property="Background" Value="Cyan"/>
</Style>
</ResourceDictionary>
</visualizationToolkit:ResourceDictionaryCollection>
Sorry for the long post.ThanksNathalie