Skip to main content

Microsoft Silverlight

Answered Question Path Element - Stretch="Fill" doesn't workRSS Feed

(0)

josi.martarelli
josi.mar...

Member

Member

3 points

8 Posts

Path Element - Stretch="Fill" doesn't work

Hello everyone,

I'm design an elastic layout in blend and have had difficult to set a path element to stretch until the end of it's container.

Here is the code:

 

1    			<Border x:Name="brdGlassTop" Height="40" BorderBrush="#FF1B1A20" BorderThickness="1" CornerRadius="5" Grid.Row="1" Grid.Column="1">
2    				<Canvas x:Name="cvsGlassTop">
3    					<Path Fill="{StaticResource Brush1}" Stretch="Fill" Stroke="#FF737A8B" Height="39" UseLayoutRounding="False" Data="M5.5000014,0.5 L601.5,0.5 C604.26141,0.49999881 606.5,2.738575 606.5,5.5000019 L606.5,38.500004 L1.5000002,38.500004 L0.5,38.600811 L0.5,5.5000019 C0.49999875,2.738575 2.738575,0.49999881 5.5000014,0.5 z" MinWidth="618"/>
4    					<Path Fill="#FFA0A8CD" Stretch="Fill" Stroke="#FF434A5D" Height="21" Opacity="0.7" OpacityMask="{StaticResource Style_OpacityMask_Glassy}" UseLayoutRounding="False" Data="M5.5000086,0.5 L594.5,0.5 C597.26141,0.49999565 599.5,2.7385714 599.5,5.4999995 L599.5,20.499998 L0.5,20.499998 L0.5,5.4999995 C0.50000298,2.7385714 2.738579,0.49999565 5.5000086,0.5 z" MinWidth="618"/>
5    				</Canvas>
6    			</Border>

 

The Border and Canvas containers are being stretched correctly.  

 

Thank you,

Josimari Martarelli
Silverlight UI Design
ESL Sistemas Logísticos

prujohn
prujohn

Contributor

Contributor

3579 points

704 Posts

Answered Question

Re: Path Element - Stretch="Fill" doesn't working

Hi, I think I get what you are trying to do... try this (I had to remove some of your styles to test it on my machine, but you can put them back in):

 

        <Border x:Name="brdGlassTop" Height="40" BorderBrush="#FF1B1A20" BorderThickness="1" CornerRadius="5">
            <Grid x:Name="gridGlassTop">
                <Path Fill="Blue" Stretch="Fill" Stroke="#FF737A8B" Height="39" UseLayoutRounding="False" Data="M5.5000014,0.5 L601.5,0.5 C604.26141,0.49999881 606.5,2.738575 606.5,5.5000019 L606.5,38.500004 L1.5000002,38.500004 L0.5,38.600811 L0.5,5.5000019 C0.49999875,2.738575 2.738575,0.49999881 5.5000014,0.5 z" />
                <Path VerticalAlignment="Top" Fill="#FFA0A8CD" Stretch="Fill" Stroke="#FF434A5D" Height="21" Opacity="0.7"  UseLayoutRounding="False" Data="M5.5000086,0.5 L594.5,0.5 C597.26141,0.49999565 599.5,2.7385714 599.5,5.4999995 L599.5,20.499998 L0.5,20.499998 L0.5,5.4999995 C0.50000298,2.7385714 2.738579,0.49999565 5.5000086,0.5 z"/>
            </Grid>
        </Border>
  

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities