ListBox control not resizing when window is maximized

ListBox control not resizing when window is maximized

I am still new to VS, C# and XAML. I have this code below

I am still new to VS, C# and XAML. I have this code below

<Window x:Class="KANASoft___Xplora.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        WindowStartupLocation="CenterScreen" Icon="folder.gif" ResizeMode="CanResizeWithGrip"
        Title="KANASoft - Xplora" Height="700" Width="535" Background="Black" Name="mainWindow">
    <Grid Height="{Binding ElementName=mainWindow, Path=Height}" Width="{Binding ElementName=mainWindow, Path=Width}">
        <ListBox Background="Black" Name="LBHeader" BorderBrush="Aqua" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderThickness="0 0 0 1" Height="80" VerticalAlignment="Top">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal" Width="{Binding ElementName=mainWindow, Path=Width}"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </Grid>
</Window>

I want my <ListBox Name="LBHeader"> to resize according to the window's width when the window is resized and it works fine when I resize the window by dragging the window edges. But the problem is that when I maximize the window, the <ListBox Name="LBHeader"> doesn't resize with the window.

Please I need help on this.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Variable Introduction in C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a speci...