2013-04-14 31 views
1

我想要顯示像這三位控制:如何替換自定義Windows Phone控件上的固定寬度和高度?

enter image description here

我的問題是,我不希望有固定的「寬度」和「高度」爲位圖。他們必須把所有可用的空間放在原來的位置並保持其方面。

當我'與混合設計它,設計師總是把固定大小....

這裏是我的代碼:

<UserControl x:Class="" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
FontFamily="{StaticResource PhoneFontFamilyNormal}" 
FontSize="{StaticResource PhoneFontSizeNormal}" 
Foreground="{StaticResource PhoneForegroundBrush}" 
> 

<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}"> 
    <Image HorizontalAlignment="Left" Height="203" Margin="53,30,0,0" VerticalAlignment="Top" Source="/FakeData/Images/lavieestbelle.jpg" RenderTransformOrigin="0.5,0.5" Width="144" UseLayoutRounding="False" d:LayoutRounding="Auto"> 
      <Image.RenderTransform> 
       <CompositeTransform Rotation="-15"/> 
      </Image.RenderTransform> 
     </Image> 
     <Image HorizontalAlignment="Left" Height="203" Margin="88,30,0,0" VerticalAlignment="Top" Source="/FakeData/Images/lavieestbelle.jpg" Width="144"/> 
     <Image HorizontalAlignment="Left" Height="203" Margin="132.951,34.5,0,0" VerticalAlignment="Top" Source="/FakeData/Images/lavieestbelle.jpg" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Width="144"> 
      <Image.RenderTransform> 
       <CompositeTransform Rotation="15"/> 
      </Image.RenderTransform> 
     </Image> 
</Grid> 

我怎麼能這樣做?感謝所有幫助

+0

你們是不是在XAML或代碼更新呢?我很困惑你爲什麼說它是一個固定的高度。 –

回答

相關問題