Hi,
i try to render WPF content with telerik chart-controls in VB6. This is possible if you are using the Microsoft Interop Forms Toolkit (http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx). If i'm using the 2D controls everiting is fine. But if I switch to 3D I get a OutOfMemoryException or NullReferenceException.
Here is my XAML:
This is the code-behind from the 2D version:
And here is the code-behind from the 3D version:
The same code works in a normal .NET-project and also in a WinForms-project on the ElementHost.
Best regards,
Dimi
i try to render WPF content with telerik chart-controls in VB6. This is possible if you are using the Microsoft Interop Forms Toolkit (http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx). If i'm using the 2D controls everiting is fine. But if I switch to 3D I get a OutOfMemoryException or NullReferenceException.
Here is my XAML:
<UserControl x:Class="UserControl1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:charts="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"> |
<Grid> |
<charts:RadChart x:Name="MyChart"/> |
</Grid> |
</UserControl> |
This is the code-behind from the 2D version:
Public Sub New() |
' This call is required by the Windows Form Designer. |
InitializeComponent() |
' Add any initialization after the InitializeComponent() call. |
MyChart.DefaultSeriesDefinition = New BarSeriesDefinition |
Dim itemSource As Double() = {5, 9, 17, 10, 11, 3, 12} |
MyChart.ItemsSource = itemSource |
End Sub |
And here is the code-behind from the 3D version:
Public Sub New() |
' This call is required by the Windows Form Designer. |
InitializeComponent() |
' Add any initialization after the InitializeComponent() call. |
MyChart.DefaultSeriesDefinition = New Bar3DSeriesDefinition |
Dim itemSource As Double() = {5, 9, 17, 10, 11, 3, 12} |
MyChart.ItemsSource = itemSource |
AddHandler MyChart.DefaultView.ChartArea.Loaded, AddressOf Me.RadChart_Loaded |
End Sub |
Private Sub RadChart_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) |
Dim camera As New CameraExtension |
camera.SpinAxis = SpinAxis.XY |
camera.ZoomEnabled = True |
MyChart.DefaultView.ChartArea.Extensions.Add(camera) |
End Sub |
The same code works in a normal .NET-project and also in a WinForms-project on the ElementHost.
Best regards,
Dimi