Custom control deirved from FrameworkElement
Last post 05-13-2008 3:55 PM by Sam Anderson. 3 replies.
Sort Posts:
03-13-2008 12:27 AM
Hmm [^o)]Custom control deirved from FrameworkElement

Hi

I want to port a custom control that I have in WPF, it is derived from FrameworkElement and all the painting I do myself in OnRender method. However when I try to derive form FrameworkElement on SL2b1 I get an error
Error    1    The type 'System.Windows.FrameworkElement' has no constructors defined   
why that class has a private constructor.
Since, in my control (trading chart) I do all the paintings myself there is no reason for me to derive from Control or even more from UserControl.
So, what would be for me easiest solution to have a code that I could use under WPF and SL?


thx

 

EugenUS

Loading...
Joined on 09-05-2007
Prescott, AZ
Posts 48
03-13-2008 6:46 AM
Marked as Answer
Re: Custom control deirved from FrameworkElement

There are two issues:

 You should be able to derive from FrameworkElement (i've done this before)...but OnRender is not supported in Silverlight 2....so converting the control may be more difficult.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 2 Workshop
September 15-17, 2008 - Denver, CO
September 22-24, 2008 - New York, NY
http://www.silverlight-tour.com

swildermuth

Loading...
Joined on 10-13-2003
Atlanta, GA
Posts 1,182
03-24-2008 4:38 AM
Re: Re: Custom control deirved from FrameworkElement

whats the idea to derive from Frameworkelement and the OnRender not supported. and how can we workarround this.

Sam Anderson

Loading...
Joined on 03-22-2008
Posts 7
05-13-2008 3:55 PM
Re: Re: Custom control deirved from FrameworkElement
also how can he derive from framework element and it has internal constructor!!!!!!!!!!!!!!!
Sam Anderson

Loading...
Joined on 03-22-2008
Posts 7
Page view counter