Pranay Rana
Pranay Rana

Reputation: 176936

Can anyone tell me what "dataviz" is?

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

Upvotes: 3

Views: 859

Answers (1)

AnthonyWJones
AnthonyWJones

Reputation: 189495

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.

Upvotes: 7

Related Questions