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.
Why my image won't enlarge on width?
Here the screenshots:
The gray image is rounded also at dx, like sx side.Here the config:
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 Foregroun开发者_高级运维d="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!!!EDIT 2: Changing default orientation will not enlarge my grid!
<controls:PanoramaItem Foreground="Black" Width="438" Orientation="Horizontal">
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
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"
Just remove the margin attribute from your image tag
<Image Source="JobRow.png" Stretch="None" />
Hope this helps
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
精彩评论