Good People,
I am experiencing serious problems getting my XamCharts to work. When I try to use Expression Blend to create series and data point then perform bindings, it generates an error message stating that: the enumerator is not valid because the collection has changed. Then, if I persist, expression blend crashes. Overall, I am finding it very difficult to work with the xamChart control in expression blend, and even in visual studio in the xaml editor. It makes expression blend very unstable. Furthermore, it's as if any attempt to set bindings on the charts renders them inoperable.
Essentially, my strategy is to set the XamChart's datacontext and then bind the datapoints in a series, or map a series to the relevant property. Unfortunately, while this has worked for one chart, it won't work for others.
Any help would be greatly appreciated. We are nearing a production deadline and the charts are the only outstanding tasks.
I am using Expressoin Blend 2008 sp1, Visual Studio 2008 and .Net 3.5 sp1. I am using the Net Advantage for WPF 2009 volume 1.
Thanks in advance and I look forward to hearing from you.
Particularly for an exception like this, I would normally recommend that you submit a support request so that Developer Support can look into this issue and aid you in finding a resolution. I see that you've already submitted such a request.
I am having the same issue - getting the "enumerator is not valid because the collection changed" exception in Blend.
I have a XamChart with two of series of ChartType = "stackedColumn" hosted inside a user control. Whenever I add the user control to a window, Blend stops rendering the window and shows the error above.
The funny thing is that I have another XamChart with one series of ChartType = "bar" hosted inside another user control - and there are no problems with that one.
I will open a ticket with support, but it would be great if the workarounds were posted here - it's a lot faster to get the information.
Hey, I feel your pain.
The solution, I found, is that you should not set the DataContext in Xaml. You can set the DataContext in the C# code behind at will.
Let me know if that helps.
I hope it does.
Unfortunately, I'm not setting the datacontext in XAML. I just have a series defined - see below.As soon as I add the user control below to a window, Blend does not render with window and displays the exception:
"Getting the "enumerator is not valid because the collection changed"
Emmanuel
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:igCA="http://infragistics.com/Chart" x:Class="ucMetricProduction" Background="#FFD6E6FA" FontFamily="Arial" FontSize="11" mc:Ignorable="d"> <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Resources/infragistics/Brushes.xaml"/> <ResourceDictionary Source="Resources/infragistics/Carousel.xaml"/> <ResourceDictionary Source="Resources/infragistics/Frame.xaml"/> <ResourceDictionary Source="Resources/infragistics/Tabs.xaml"/> <ResourceDictionary Source="Resources/infragistics/Misc.xaml"/> <ResourceDictionary Source="Resources/infragistics/Buttons.xaml"/> <ResourceDictionary Source="Resources/infragistics/xamChart/Default/Chart2D.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" IsEnabled="True"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!-- Chart control --> <igCA:XamChart x:Name="xcChart1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="0" StartPaletteBrush="#FF076CB0" > <!-- Legend --> <igCA:XamChart.Legend> <igCA:Legend Visible="False"/> </igCA:XamChart.Legend> <!-- Scene --> <igCA:XamChart.Scene> <igCA:Scene BorderBrush="Black"> <igCA:Scene.GridArea> <igCA:GridArea Style="{StaticResource GridAreaStyle}"/> </igCA:Scene.GridArea> </igCA:Scene> </igCA:XamChart.Scene> <!-- Data points --> <igCA:XamChart.Series> <igCA:Series Label="Funded" ChartType="stackedColumn" > <igCA:Series.DataPoints> <igCA:DataPoint Value="2.6" Label="Nov"/> <igCA:DataPoint Value="2.5" Label="Dec"/> <igCA:DataPoint Value="3.3" Label="Jan"/> <igCA:DataPoint Value="1.6" Label="Feb"/> <igCA:DataPoint Value="0" Label="Mar"/> </igCA:Series.DataPoints> <igCA:Series.Animation> <igCA:Animation BeginTime="00:00:01"/> </igCA:Series.Animation> </igCA:Series> <!-- Data points --> <igCA:Series Label="Projected" ChartType="stackedColumn" UseDataTemplate="True"> <igCA:Series.DataPoints> <igCA:DataPoint Value="0"/> <igCA:DataPoint Value="0"/> <igCA:DataPoint Value="0"/> <igCA:DataPoint Value="1"/> <igCA:DataPoint Value="3"/> </igCA:Series.DataPoints> <igCA:Series.Animation> <igCA:Animation BeginTime="00:00:02"/> </igCA:Series.Animation> </igCA:Series> </igCA:XamChart.Series> <!-- Axes --> <igCA:XamChart.Axes> <igCA:Axis AxisType="PrimaryX" Animation="{StaticResource AxisAnimation}" MajorGridline="{StaticResource AnimationMarkX}" Label="{StaticResource AnimationLabelsX}"/> <igCA:Axis AxisType="PrimaryY" Animation="{StaticResource AxisAnimation}" MajorGridline="{StaticResource AnimationMarkY}" Label="{StaticResource AnimationLabelsY}"> <igCA:Axis.Stripes> <igCA:Stripe Style="{StaticResource StripeStyle}"/> </igCA:Axis.Stripes> </igCA:Axis> </igCA:XamChart.Axes> <igCA:XamChart.Caption> <igCA:Caption FontFamily="Arial" FontSize="16" FontStretch="Expanded" FontWeight="SemiBold" Text="Title Here" /> </igCA:XamChart.Caption> </igCA:XamChart> <Grid x:Name="grdButtons" HorizontalAlignment="Left" Height="30" VerticalAlignment="Top" Background="#4C333333"> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.33*"/> <ColumnDefinition Width="0.33*"/> <ColumnDefinition Width="0.933*"/> </Grid.ColumnDefinitions> <Border Grid.ColumnSpan="3" BorderThickness="1,1,1,1" BorderBrush="#9FFFFFFF"/> <ToggleButton x:Name="tgb1" Content="L" Cursor="Hand" FontWeight="Normal" FontSize="10" Margin="1,0,1,0" d:LayoutOverrides="GridBox" ToolTip="By Loan volume" Width="18" Height="18" IsChecked="True"/> <ToggleButton x:Name="tgb2" Content="#" Cursor="Hand" FontWeight="Normal" FontSize="10" ToolTip="By number of Loans" Grid.Column="1" Grid.ColumnSpan="1" Margin="1,0,1,0" Width="18" Height="18"/> <ToggleButton x:Name="tgb3" Content="$" Width="18" Cursor="Hand" FontWeight="Normal" FontSize="10" Margin="1,0,1,0" HorizontalAlignment="Left" ToolTip="By Commission" Grid.Column="2" Height="18"/> </Grid> <Rectangle Opacity="0.595" Fill="#A7FFFFFF" Stroke="{x:Null}" HorizontalAlignment="Stretch" Margin="0,30,0,0" VerticalAlignment="Stretch" Visibility="Hidden" x:Name="recCover" Panel.ZIndex="2"/> <TextBlock VerticalAlignment="Bottom" Text="Sample" TextWrapping="Wrap" Margin="0,0,0,65" Padding="0,0,4,0" x:Name="tbSample" Panel.ZIndex="3" HorizontalAlignment="Center" FontSize="36" FontWeight="Normal" FontStyle="Italic" RenderTransformOrigin="0.5,0.5" TextDecorations="Underline" Visibility="Hidden"> <TextBlock.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1" ScaleY="1"/> <SkewTransform AngleX="0" AngleY="0"/> <RotateTransform Angle="-29"/> <TranslateTransform X="0" Y="0"/> </TransformGroup> </TextBlock.RenderTransform> <TextBlock.Foreground> <SolidColorBrush Color="{DynamicResource colorExcludedChanged}"/> </TextBlock.Foreground> </TextBlock> </Grid> </Border></UserControl>
Hello Emmanuel,
Has this issue been resolved?
I received the same error message with WPF DV 10.2 in Visual Studio 2010 when I was doing trial license expiration testing. I was able to solve the problem by deleting all content in the licenses.licx file. This file should be located in your project folder under the Properties subfolder.
This might be a different issue than you experienced, as I was advised that this is a common error message in .NET. I would suggest backing up the licenses.licx file and then deleting all content.
Elizabeth Albert
Localization Engineer