Windows Vista Forums
Vista Forums Home Join Vista Forums Donate 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

Specifying Dynamic Values in XAML?

Closed Thread
 
Thread Tools Display Modes
Old 12-03-2006   #1 (permalink)
john
Guest


 

Specifying Dynamic Values in XAML?

All:

In developing a custom control (UserControl), I have a StackPanel with
a gradient background and a TextBlock. This works fine. Now, I am
attempting to round the corners of the StackPanel. I can do this with
various clipping/Geometry objects, e.g., RectangleGeometry, etc.

Now, the problem I'm facing is that all of the clipping/geometry
objects seem to need a fixed size, e.g., Rect="0,0,100,100". Now, I
want my StackPanel to grow and shrink with it's parent (it is to be
placed on a Grid whose "cell" sizes grow and shrink with respect to the
host Window).

So, the goal is to have a rounded rect imposed on the StackPanel as it
grows and shrinks -- therefore, I cannot assign a fixed sized to the
clipping region/geometry -- I need the clipping region to grow in
shrink as well, in proportion to the StackPanel it's clipping.

Ideas? A better way to approach this?

Thanks,
John - jpuopolo

Old 12-03-2006   #2 (permalink)
Laurent Bugnion
Guest


 

Re: Specifying Dynamic Values in XAML?

Hi,

john wrote:
> All:
>
> In developing a custom control (UserControl), I have a StackPanel with
> a gradient background and a TextBlock. This works fine. Now, I am
> attempting to round the corners of the StackPanel. I can do this with
> various clipping/Geometry objects, e.g., RectangleGeometry, etc.
>
> Now, the problem I'm facing is that all of the clipping/geometry
> objects seem to need a fixed size, e.g., Rect="0,0,100,100". Now, I
> want my StackPanel to grow and shrink with it's parent (it is to be
> placed on a Grid whose "cell" sizes grow and shrink with respect to the
> host Window).
>
> So, the goal is to have a rounded rect imposed on the StackPanel as it
> grows and shrinks -- therefore, I cannot assign a fixed sized to the
> clipping region/geometry -- I need the clipping region to grow in
> shrink as well, in proportion to the StackPanel it's clipping.
>
> Ideas? A better way to approach this?
>
> Thanks,
> John - jpuopolo


You think too much in GDI. Forget what you learned. You don't need to
draw the figures yourself. If you want to set borders to a StackPanel,
just use a Border control.

<StackPanel>
<Border CornerRadius="10" BorderBrush="Red" BorderThickness="5">
<TextBlock Text="Hello" />
</Border>
</StackPanel>

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Old 12-03-2006   #3 (permalink)
Laurent Bugnion
Guest


 

Re: Specifying Dynamic Values in XAML?

Hi,

john wrote:
> All:
>
> In developing a custom control (UserControl), I have a StackPanel with
> a gradient background and a TextBlock. This works fine. Now, I am
> attempting to round the corners of the StackPanel. I can do this with
> various clipping/Geometry objects, e.g., RectangleGeometry, etc.
>
> Now, the problem I'm facing is that all of the clipping/geometry
> objects seem to need a fixed size, e.g., Rect="0,0,100,100". Now, I
> want my StackPanel to grow and shrink with it's parent (it is to be
> placed on a Grid whose "cell" sizes grow and shrink with respect to the
> host Window).
>
> So, the goal is to have a rounded rect imposed on the StackPanel as it
> grows and shrinks -- therefore, I cannot assign a fixed sized to the
> clipping region/geometry -- I need the clipping region to grow in
> shrink as well, in proportion to the StackPanel it's clipping.
>
> Ideas? A better way to approach this?
>
> Thanks,
> John - jpuopolo


You think too much in GDI. Forget what you learned. You don't need to
draw the figures yourself. If you want to set borders to a StackPanel,
just use a Border control.

<StackPanel>
<Border CornerRadius="10" BorderBrush="Red" BorderThickness="5">
<TextBlock Text="Hello" />
</Border>
</StackPanel>

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Old 12-03-2006   #4 (permalink)
john
Guest


 

Re: Specifying Dynamic Values in XAML?

Laurent:

Guilty as charged - 15 years of Win32/.NET 2.0 conditioning...:-)

Thanks - I'll give it a try...

Best,
John


Laurent Bugnion wrote:
> Hi,
>
> john wrote:
> > All:
> >
> > In developing a custom control (UserControl), I have a StackPanel with
> > a gradient background and a TextBlock. This works fine. Now, I am
> > attempting to round the corners of the StackPanel. I can do this with
> > various clipping/Geometry objects, e.g., RectangleGeometry, etc.
> >
> > Now, the problem I'm facing is that all of the clipping/geometry
> > objects seem to need a fixed size, e.g., Rect="0,0,100,100". Now, I
> > want my StackPanel to grow and shrink with it's parent (it is to be
> > placed on a Grid whose "cell" sizes grow and shrink with respect to the
> > host Window).
> >
> > So, the goal is to have a rounded rect imposed on the StackPanel as it
> > grows and shrinks -- therefore, I cannot assign a fixed sized to the
> > clipping region/geometry -- I need the clipping region to grow in
> > shrink as well, in proportion to the StackPanel it's clipping.
> >
> > Ideas? A better way to approach this?
> >
> > Thanks,
> > John - jpuopolo

>
> You think too much in GDI. Forget what you learned. You don't need to
> draw the figures yourself. If you want to set borders to a StackPanel,
> just use a Border control.
>
> <StackPanel>
> <Border CornerRadius="10" BorderBrush="Red" BorderThickness="5">
> <TextBlock Text="Hello" />
> </Border>
> </StackPanel>
>
> HTH,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch


Old 12-03-2006   #5 (permalink)
john
Guest


 

Re: Specifying Dynamic Values in XAML?

Laurent:

Guilty as charged - 15 years of Win32/.NET 2.0 conditioning...:-)

Thanks - I'll give it a try...

Best,
John


Laurent Bugnion wrote:
> Hi,
>
> john wrote:
> > All:
> >
> > In developing a custom control (UserControl), I have a StackPanel with
> > a gradient background and a TextBlock. This works fine. Now, I am
> > attempting to round the corners of the StackPanel. I can do this with
> > various clipping/Geometry objects, e.g., RectangleGeometry, etc.
> >
> > Now, the problem I'm facing is that all of the clipping/geometry
> > objects seem to need a fixed size, e.g., Rect="0,0,100,100". Now, I
> > want my StackPanel to grow and shrink with it's parent (it is to be
> > placed on a Grid whose "cell" sizes grow and shrink with respect to the
> > host Window).
> >
> > So, the goal is to have a rounded rect imposed on the StackPanel as it
> > grows and shrinks -- therefore, I cannot assign a fixed sized to the
> > clipping region/geometry -- I need the clipping region to grow in
> > shrink as well, in proportion to the StackPanel it's clipping.
> >
> > Ideas? A better way to approach this?
> >
> > Thanks,
> > John - jpuopolo

>
> You think too much in GDI. Forget what you learned. You don't need to
> draw the figures yourself. If you want to set borders to a StackPanel,
> just use a Border control.
>
> <StackPanel>
> <Border CornerRadius="10" BorderBrush="Red" BorderThickness="5">
> <TextBlock Text="Hello" />
> </Border>
> </StackPanel>
>
> HTH,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to include XAML files into another XAML file? star-italia .NET General 6 06-12-2008 04:56 AM
dynamic loading xaml Dave Avalon 0 11-27-2007 02:58 PM
launching different XAML aplication from another XAML app SenthilVel Avalon 0 03-31-2007 09:40 PM
How to deploy an XAML-based App with its XAML-UI-File? Solveigh Avalon 11 11-08-2006 07:50 AM
File.xaml and File.xaml.cs are atomically checked out/in from sourcesafe Pascal Bourque Avalon 1 04-26-2006 06:47 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