【问题标题】:How to replace fixed width and height on a custom windows phone control?如何替换自定义 Windows Phone 控件上的固定宽度和高度?
【发布时间】:2013-04-14 10:04:03
【问题描述】:

我想制作一个像这样显示三个位图的控件:

我的问题是我不想为位图固定“宽度”和“高度”。他们必须占据所有可用空间并保持其方面。

当我用 Blend 设计它时,设计师总是把固定尺寸放在...

这是我的代码:

<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>

我该怎么做?感谢您的帮助

【问题讨论】:

  • 您是要在 XAML 中还是在代码中更新它?我对你为什么说它是固定高度感到困惑。

标签: xaml user-controls windows-phone expression-blend


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-12
    • 1970-01-01
    • 2012-09-13
    • 1970-01-01
    • 1970-01-01
    • 2019-11-16
    • 2018-03-20
    相关资源
    最近更新 更多