开发者

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

开发者 https://www.devze.com 2023-02-28 17:06 出处:网络
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\">

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

精彩评论

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