elp
elp

Reputation: 8131

Why image don't autosize in grid panel?

I tried to make a wp7 app with expression blend. But is there a problem that make me crazy!

I created a Panorama Controller, a Panorama Item and a Grid. In this grid i create an Image.
enter image description here

Why my image won't enlarge on width?

Here the screenshots:
enter image description here
The gray image is rounded also at dx, like sx side.

Here the config:
enter image description here

Is there a solution to enlarge my image on width like max size of grid?

How can I do this?

This is my snippet of code:

<controls:PanoramaItem Foreground="Black" >
  <Grid Margin="1,26,160,46" Width="418">
    [...]
    <Grid Margin="0,190,8,0" VerticalAlignment="Top" Height="207" >
      <Image Source="JobRow.png" Margin="8,34,27,50" Stretch="None" />
    </Grid>
  </Grid>
</controls:PanoramaItem>

Any idea please?

EDIT 1: if I change Stretch this is the result, my image enlarge only in height!
It's like that is blocked at certain position... but i don't know why!!!

enter image description here

EDIT 2: Changing default orientation will not enlarge my grid!

<controls:PanoramaItem Foreground="Black" Width="438" Orientation="Horizontal">

Upvotes: 3

Views: 619

Answers (4)

elp
elp

Reputation: 8131

Ok, solved removing all Width="xxx" from XAML file and after, from Expression Blend, manually resizing all the components.

I don't know why, but it works!

thanks all

Upvotes: 0

Matt Lacey
Matt Lacey

Reputation: 65556

You need to set the Stretch property on the image if you want it to grow to fill all the available space. Depending on how you want it to distort or get trimmed to fill the available space you want it to be one of Fill, Uniform or UniformToFill.

Edit:
If the stretched Image woudl now go beyond the default width of the PanoramaItem, be sure to set the Orientation of the PanoramaItem to be Horizontal so it can support the necessary growth needed in that direction

Upvotes: 1

Waleed
Waleed

Reputation: 3145

Just remove the margin attribute from your image tag

<Image Source="JobRow.png" Stretch="None" />

Hope this helps

Upvotes: 0

Rick Sladkey
Rick Sladkey

Reputation: 34250

Look at the properties that define the XAML file your are editing (Page, UserControl, etc.). Does it have a setting like this?

 d:DesignWidth="300"

If so, change it to a larger value like this:

 d:DesignWidth="800"

Upvotes: 0

Related Questions