I have an image I want to display in a control in a touch application. As well as the image there is a textbox to display underneath it, as a tab, docked at the bottom left of the image. The tab has a lower width than the image. The user can resize, move and rotate the image, but I'd like the textbox tab to stay the same size and in the same relative position to the image.
I've tried using both a StackPanel and a Grid, but both times the textbox/tab is scaled up as well as the image.
Are either a Grid or StackPanel the way to go, and if so how can I enforce the size of the textbox/tab (that is, the second child) as the size of the first child changes?
Thanks!
In respones to Lars:
<Grid Name="mygrid" Background="Red" Width="320" Height="300">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="255"/>
<RowDefinition MaxHeight="40" />
</Grid.RowDefinitions>
<!--Ist child-->
<Canvas Name="maincanvas" Background="DarkKhaki" Width="300" Height="180" Grid.Row="0">
<!--<Image goes in here>-->
</Canvas>
<!--2nd child-->
<DockPanel Name="dockpanel" Grid.Row="1" Background="DarkKhaki" MaxWidth="200" HorizontalAlignment="Left">
<TextBlock Name="textblock" TextWrapping="Wrap" >
some text here
</TextBlock>
</DockPanel>
</Grid>
What I want to do is allow the user to drag and resize the Image(1st child), while maintaining the size and relative position of the TextBlock (2nd child). So the effect is of a tab anchored to the bottom left of the image that is fixed as the image can dynamically resize.
I tried to add images to make this clearer but as a new user I can't, sorry!