When you set the Palette property to a new instance of ChartPalette in XAML, a NullReferenceException is thrown. This happens when you click inside the chart control in the Visual Studio designer.
The exception reproduces only if the "Miscellaneous" category in the "Properties" pane of Visual Studio is expanded.
To work this around, set the Palette property in code:
C#:
public
MainWindow()
{
InitializeComponent();
this
.chart.Palette = (ChartPalette)
this
.Resources(
"cpBarChart"
);
}
Sub
New
()
InitializeComponent()
Me
.chart.Palette =
DirectCast
(
Me
.Resources(
"cpBarChart"
), ChartPalette)
End
Sub