Visual inheritance in WPF
- From: Matt B <rounderweget@xxxxxxxxx>
- Date: Tue, 17 Jun 2008 12:01:15 -0700 (PDT)
I was hoping someone out there has had experience in this area and
could lend a hand with an idea I've been working on.
I have a UserControl that, using a template, has a colored area at the
top with several buttons (almost like a re-creation of the Window
class). There is no xaml file associated with this UserControl, the
template is in a ResourceDictionary in the same assembly. If I use
this control in a window with a Canvas, everything works as I expect
and I don't seem to have any problems. I can do something like the
following:
<myUserControl>
<Grid>
<TextBox Height="20" Width="50" />
</Grid>
</myUserControl>
If I inherit from this UserControl and and a xaml file with the same
xaml code as above, however, it does not display properly. The
colored section and buttons that are in the template are not shown at
all. The only thing that is shown is the TextBox (in the above
example).
I understand that you are unable to inherit a xaml code file and then
extend it, but I assumed that you could inherit from a .cs file that
has a template applied to it.
Has anyone worked in this area before and have any suggestions?
Thank you,
Matt
.
- Prev by Date: Re: TCP socket question
- Next by Date: Re: How to get text width and hieght in a richtext box
- Previous by thread: linq question
- Next by thread: Get generic type fullname without assembly version,culture and PublicKeyToken
- Index(es):