开发者

Set min height but not max

开发者 https://www.devze.com 2023-03-03 19:38 出处:网络
I have the following XAML code: <DataTemplate x:Key=\"NewsDataTemplate\"> <StackPanel Width=\"400\" Height=\"100\" Orientation=\"Horizontal\" H开发者_如何学CorizontalAlignment=\"Center\" Ver

I have the following XAML code:

<DataTemplate x:Key="NewsDataTemplate">
    <StackPanel Width="400" Height="100" Orientation="Horizontal" H开发者_如何学CorizontalAlignment="Center" VerticalAlignment="Center" >
        <TextBlock x:Name="NewsText" Text="{Binding Text}" Margin="8,4" TextWrapping="Wrap" Width="384" Style="{StaticResource PhoneTextGroupHeaderStyle}" />
    </StackPanel>
</DataTemplate>

I want to NewsText TextBlock can be as height as it needs but also I want to set a minimum height: NewsText will have 100 or higher height.

How can I do that?


Try the MinHeight property...

FrameworkElement.MinHeight Property

0

精彩评论

暂无评论...
验证码 换一张
取 消