WPF Derived Control

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Given
Newbie
Newbie
Posts: 3
Joined: Wed Jun 10, 2009 12:00 am

WPF Derived Control

Post by Given » Tue Jul 07, 2009 9:02 am

Hi,

I'm trying to use TeeChart as derived control in a WPF application.
I've created a simple class:
public class GraphBasicControl : TChart {}

and when I try to use it (create an instance):
GraphBasicControl test = new GraphBasicControl();

I'm getting an exception:
"
The component 'GraphExtendedPH' does not have a resource identified by the URI '/TeeChart.WPF;component/wpfteechart.xaml'.
"

If I try to continue, then everything is working fine.

Please advice.

- Sharon

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: WPF Derived Control

Post by Yeray » Tue Jul 07, 2009 11:40 am

Hi Sharon,

Could you please send us a simple example project we can run as-is to reproduce the problem here? (Note that you can attach files directly with the forum messages)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Given
Newbie
Newbie
Posts: 3
Joined: Wed Jun 10, 2009 12:00 am

Re: WPF Derived Control

Post by Given » Tue Jul 07, 2009 11:53 am

Hi,

Thanks for replying. It's actually very simple:
Create a WPF Application:

Code: Select all

public class ChartDemo : TChart
        {
        }        

        public Window1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ChartDemo chartDemo = new ChartDemo();
        }
I've attached a sample project, just in case.
BTW, I'm having other strange issues with the WPF version, I've worked with the WinForm version and now I'm converting it to WPF.
I'm using a DLL to wrap TeeChart with the functioinlity required by our application, I can skip the exception, if I continue the program execution after the exception, the chart is loading. When I try to show the TeeChart editor, nothing happens:
TeeChartControlInstance.ShowEditor();

Please advice.

- Sharon
Attachments
WpfApplicationDemoForTeeChart.zip
WPF Demo application
(7.43 KiB) Downloaded 202 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: WPF Derived Control

Post by Yeray » Tue Jul 07, 2009 2:08 pm

Hi Given,

Yes you are right, I've added this bug to the wish list to be fixed asap (TW16014279).

And regarding the editor, here it was discussed.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Given
Newbie
Newbie
Posts: 3
Joined: Wed Jun 10, 2009 12:00 am

Re: WPF Derived Control

Post by Given » Tue Jul 07, 2009 2:29 pm

Hi Alonso,

Thanks for the reply.

1. Do you have any time estimation when this will be fixed and how (patch/new version)?
2. I have some other critical problems with the WPF version. This is the one I'm working on:
In the WinForm version, I've added a scroll bar in case the user zoom in, this was quite complex since the bottom axis is using datetime format but I've managed to handle it.
The control I've used was HScrollBar, which of course, I cannot use now, instead I'm using ScrollBar which is UIElement.
In the previous version, the HScrollBar was added to the "Controls" of the chart:

Code: Select all

m_BasicGraph.Children.Add(m_HScrollBar);
this cannot be done with WPF, hence I'm *trying* to use "Children":

Code: Select all

m_BasicGraph.Children.Add(hSBar);
The problem is that "Children" is not set properly in the chart, whenever I try to use it I'm getting an exception: "'m_BasicGraph.Children' threw an exception of type 'System.NullReferenceException'"

I don't think a sample project is required, just open the debugger and try to access the "Children" and you will see the problem.

Please advice.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: WPF Derived Control

Post by Yeray » Wed Jul 08, 2009 1:26 pm

Hi Given,

1. We plan to publish a new NET maintenance release for v2009 around 12th August but I'm afraid that I can't tell you if this will be fixed or not. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's implemented on them.

2. I'm getting an error adding controls created in design time into a chart but also into other components so it doesn't seem to be a TeeChart problem. For example, once a scroll bar is created at design time, the following crashes:

Code: Select all

tChart1.Children.Add(scrollBar1);
But this crashes too:

Code: Select all

dockPanel1.Children.Add(scrollBar1);
On the other hand, creating the controls at runtime, both adding them to the chart or to the panel it seems to work fine:

Code: Select all

System.Windows.Controls.Primitives.ScrollBar myScrollBar = new System.Windows.Controls.Primitives.ScrollBar();
tChart1.Children.Add(myScrollBar);

Code: Select all

System.Windows.Controls.Primitives.ScrollBar myScrollBar = new System.Windows.Controls.Primitives.ScrollBar();
dockPanel1.Children.Add(myScrollBar);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply