开发者

How can I make a ListBox expand to fit the entire available width?

How can I make a ListBox expand to fit the entire available width?

I need to make the ListBox expand to fit the width it has available. Here's the XAML:

<ListBox Grid.Row="2" Height="400" ItemsSource="{StaticResource Notes}" VerticalAlignment="Top">
            <ListBox.ItemT开发者_开发百科emplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical" Height="90" Margin="5">
                        <TextBlock Text="{Binding Title}" FontSize="30" />
                        <TextBlock Text="{Binding Text}" FontSize="15" />
                        <Rectangle Fill="#1192D4" Height="2" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>


Please take a look at this post A ListBoxItem that fills its parent

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜