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.

c-sharp xaml

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

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

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

C. C++. C#. 차이점 알려드림. 5분 순삭. Explain C.C++.C#. Like I'm Five

C. C++. C#. 차이점 알려드림. 5분 순삭. Explain C.C++.C#. Like I'm Five. 아시죠? C는 C++.C# 줄인말이 아니라는거?

Learn how to perform CRUD operations using C Sharp

QuickStart: CRUD Operations in C Sharp. Learn how to perform CRUD operations using C Sharp for MongoDB databases.

Loops in C++ | For, While, and Do While Loops in C++

In this Video We are going to see how to use Loops in C++. We will see How to use For, While, and Do While Loops in C++.

Using isdigit() in C/C++

In this article, we'll take a look at using the isdigit() function in C/C++. This is a very simple way to check if any value is a digit or not. Let's look

C++ Tutorial for Beginners 19 - C++ Structures | Struct declaration | C++ Data Structures

Welcome to this course on C++ Tutorial for Beginners. In this video we will see How to use C++ Structures.