Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Problem nesting controls

 
 
Old 03-11-2006   #1 (permalink)
Winthrop Chan


 
 

Problem nesting controls

I'm fairly new to WPF and have been trying different things to learn.
However, I'm a bit stumped right now.

I created a default WPF application in VS2005 and the Feb CTP. I got rid of
the <grid></grid> in the Xaml file, it's pretty much an empty
<windows></windows> xaml file.

I went ahead and programmatically create a Grid control and then a
ScrollViewer control. I then call:

ScollViewerControl.Content = GridControl;

This seems to work just fine and displays correctly.

However, if I changes the XAML file to the following:

<windows ..... >
<ScrollViewer Name="svXamlControl" ScrollViewer.CanContentScroll="true">
</ScrollViewer>
</windows>

And then in my code I change it to call:

svXamlControl.Content = GridControl;

The window appears fine, but my grid control does not render! What am I
doing wrong?

The other question I have is do all user controls require an associated Xaml
file? What about cases where my control simply derives from a base control
(e.g. Grid) and just overrides a few members. Otherwise, visually, it's
identical. Do I still need an associated XAML file? If so, what would I put
in it? The base control's tags?

Many thanks,

Winthrop



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Problem with Parental Controls System Security
VBScript nesting groups cross domains VB Script
VBScript nesting groups cross domains VB Script
Parental Controls Pin Problem Vista Games


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46