![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 |
| | #2 (permalink) |
| 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 |
| | #3 (permalink) |
| 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 |
| | #4 (permalink) |
| 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 |
| | #5 (permalink) |
| 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 |
| |
| |
![]() |
| 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 |