3

Change Silverlight Chart Legend Item Layout

Can anyone please tell me what the dataviz component is in the following code (from the linked question)

<dataviz:Legend x:Name="Legend" Header="{TemplateBinding LegendTitle}" Style="{TemplateBinding LegendStyle}" Grid.Row="2"/>

I get the following error when I try to use it:

The type 'dataviz:Title' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built

Community
  • 1
  • 1
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
  • 1
    Have you tried google? I found http://www.dataviz.com – Tony Feb 08 '11 at 12:55
  • You'll have to ask the author, maybe as a comment in that question. It is a namespace prefix, which means you need to have a namespace declaration somewhere. ... Looking through your other posts, you seem to know how to write English. What happened? – R. Martinho Fernandes Feb 08 '11 at 12:56
  • It's the only reference to dataviz the search engine shows up. Perhaps the OP of the question you linked to was creating a web site for mobile devices. As Martinho Fernandes says, posting a comment on the original question might get you the answer. – Tony Feb 08 '11 at 13:03

1 Answers1

7

dataviz: was a common xml namespace alias used for the silverlight toolkit data visualisation namespce. This was for Silverlight 3 version at the time when libraries weren't able to define their own XML namespaces.

The .NET namespace System.Windows.Controls.DataVisualization would be mapped to the prefix dataviz like this:-

xmlns:dataviz="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"

With Silverlight 4 enabling libraries to define their own schema url to cover a whole range of .NET namespaces things changed to this:-

 xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"

This xmlns space covers most objects that you might want to include in Xaml (not just the charting stuff). The older style still works but generally in Silverlight 4 you only need this single alias to refer to anything in you need from the toolkit.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306