Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Problem nesting controls

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-11-2006   #1 (permalink)
Winthrop Chan
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parental Controls and printer problem spook68 Vista account administration 0 02-20-2008 01:09 PM
ActiveX controls Problem Dwaggie67 Vista security 5 10-03-2007 11:27 PM
Parental Controls dearheart606 Vista account administration 1 08-19-2007 12:00 PM
Parental Controls Pin Problem Chad Vista Games 0 05-03-2007 12:04 PM


Vistax64.com 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 2005-2008

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 47 48 49 50 51