views:

279

answers:

1

I'm walking through Adam Kinney's Blend tutorials (http://visitmix.com/labs/rosetta/EyesOfBlend/) and I'm seeing some puzzling behavior with resizing objects. Specifically, at this step (http://visitmix.com/labs/rosetta/EyesOfBlend/Drawing/#08) I'm seeing two different behaviors resizing elements. Before I group the 3 circles into a grid, if I select all 3 they all resize the way I would intend with each circle growing and shrinking to the appropriate size to maintain the original proportion and position. Now, if I group the circles into a grid and then try to resize, resizing still occurs but the proportion of the 2 inner circles does not hold. Ultimately, if I want to try resizing everything on the page, I get the latter behavior which isn't what I want. Is this intended behavior of resizing within a grid? XAML below:

<Grid x:Name="LayoutRoot" Background="White">
 <Ellipse Margin="120,40" Stroke="Black" StrokeThickness="5">
  <Ellipse.Fill>
   <RadialGradientBrush>
    <GradientStop Color="#FFFDF365" Offset="0.349"/>
    <GradientStop Color="#FFDEAE32" Offset="1"/>
    <GradientStop Color="#FFFEE834" Offset="0.711"/>
   </RadialGradientBrush>
  </Ellipse.Fill>
 </Ellipse>
 <Grid HorizontalAlignment="Left" Height="105" Margin="187,111,0,0" VerticalAlignment="Top" Width="105">
  <Ellipse Stroke="Black" StrokeThickness="5">
   <Ellipse.Fill>
    <RadialGradientBrush>
     <GradientStop Color="#FF545454" Offset="1"/>
     <GradientStop Color="White" Offset="0.845"/>
    </RadialGradientBrush>
   </Ellipse.Fill>
  </Ellipse>
  <Ellipse Fill="#FF935D09" Margin="31,30,30,31" Stroke="Black" StrokeThickness="5"/>
  <Ellipse Fill="White" Margin="38,38,50,50" Stroke="Black" StrokeThickness="0"/>
 </Grid>
</Grid>
A: 

The resizing behavior depends on which handles you grab, which may not be evident until you zoom in. I've posted a blog entry that hopefully explains what is going on.

Adam Kinney
Sorry for the long delay. In the XAML I posted above, can I select both the outer ellipse (the face) and the grid containing the 3 ellipses and have them all resize proportionally? I can see the behavior you described in the blog post (and I did not notice the 2 handles until you pointed that out, thanks) but it seems like there's no easy way to resize a collection of elements that have a grid, unless there's something I'm missing.
JHubSharp
No you can't resize them that way because of the layout behavior of the Grid. A ViewBox control is more suited to that type of functionality.
Adam Kinney