![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | xaml subclass??? I am not even sure that is the right term for this. I am not sure where to really start looking for this capability. I created a form using wpf. it is mostly a big TreeView with a couple different TreeViewItems, each of which is a Grid of other controls. I decided I wanted to be able to reuse some of the TreeViewItems in other forms. Doing what made sense I created a new class library project, copied the big form, broke out the pieces i wanted into their own classes, each derived from TreeViewItem. The first problem is that in the class library the designer reports that the root element (a TreeViewItem) is not supported. Ignoring that I went back to the main project and ripped out the TreeViewItems and replaced them with the classes from the class library project. The compiler is happy, but the designer doesn't show the items, and neither do they show in the app when running. Obviously I am missing something here, but I'm not sure what to even start searching on. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: xaml subclass??? =?Utf-8?B?ZGF2ZQ==?= <epridave@xxxxxx> wrote in news:3CD34E7D-106D-4035-8756-46659608E6F8@xxxxxx: Quote: > Obviously I am missing something here, but I'm not sure what to even > start searching on. > "visual inheritance", so I am not sure you can solve the design time problem easily. As far as runtime goes, you need to look at the final XAML and you will likely be able to get a clue what is going wrong. Not sure how to do in WPF; it is a bit easier in XBAP and Silverlight. -- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | ******************************************* |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: xaml subclass??? "Gregory A. Beamer" wrote: Quote: > =?Utf-8?B?ZGF2ZQ==?= <epridave@xxxxxx> wrote in > news:3CD34E7D-106D-4035-8756-46659608E6F8@xxxxxx: > > Quote: > > Obviously I am missing something here, but I'm not sure what to even > > start searching on. > > > I am not sure about the runtime issue, but XAML does not currently support > "visual inheritance", so I am not sure you can solve the design time > problem easily. > > As far as runtime goes, you need to look at the final XAML and you will > likely be able to get a clue what is going wrong. Not sure how to do in > WPF; it is a bit easier in XBAP and Silverlight. > > > -- > Gregory A. Beamer > MVP; MCP: +I, SE, SD, DBA > > Twitter: @gbworld > Blog: http://gregorybeamer.spaces.live.com > > ******************************************* > | Think outside the box! | > ******************************************* > shower a box. well, it looks like i was on the right track with my first guess. I was missing a call to InitializeComponent() in each of the sub classes though which let them build but they wouldn't do anything when it ran. I also had to take it one step further and create my own common base class for the sub classes which made the namespaces for the xaml a bit uglier, but it works now anyway. |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: xaml subclass??? "Gregory A. Beamer" wrote: Quote: > =?Utf-8?B?ZGF2ZQ==?= <epridave@xxxxxx> wrote in > news:3CD34E7D-106D-4035-8756-46659608E6F8@xxxxxx: > > Quote: > > Obviously I am missing something here, but I'm not sure what to even > > start searching on. > > > I am not sure about the runtime issue, but XAML does not currently support > "visual inheritance", so I am not sure you can solve the design time > problem easily. > > As far as runtime goes, you need to look at the final XAML and you will > likely be able to get a clue what is going wrong. Not sure how to do in > WPF; it is a bit easier in XBAP and Silverlight. > > > -- > Gregory A. Beamer > MVP; MCP: +I, SE, SD, DBA > > Twitter: @gbworld > Blog: http://gregorybeamer.spaces.live.com > > ******************************************* > | Think outside the box! | > ******************************************* > contents of the subclassed TreeViewItems, but the designers for the individual subclasses still show the message 'the document root element is not supported by the visual designer'. |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: xaml subclass??? =?Utf-8?B?ZGF2ZQ==?= <epridave@xxxxxx> wrote in news:1FE08864-C65D-4BB9-B963-2BC52BBAFD65@xxxxxx: Quote: > > p.s. it is interesting that now the main app designer window shows the > contents of the subclassed TreeViewItems, but the designers for the > individual subclasses still show the message 'the document root > element is not supported by the visual designer'. I have grown to expect bizarre behavior as the different bits are developed in isolation. The closer you are to the bleeding edge, the worse it is. -- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | ******************************************* |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Base class defined and initialized variables loose initialization in subclass. | .NET General | |||
| Is it possible to include XAML files into another XAML file? | .NET General | |||