Working with WinUI controls, properties, and events
It’s time to enhance the UI of the application. Currently, the main page only consists of a Media
label over a ListView
, with columns for the media type and the name of the media item. The following are the enhancements we will add in this section:
- A header row for the
ListView
- A
ComboBox
to filter the rows based on the media type - A
Button
to add a new item to the collection
We will start by enhancing the ListView
for our media collection.
Adding a ListView header
Before we create the header, let’s change the background color of the ListView
. The Aqua
color worked well to highlight the control, but it would be distracting when the application is used by our customers. We will discuss WinUI theme brushes and look at Fluent Design concepts later in Chapter 7, Fluent Design System for Windows Applications. For now, just remove Background="Aqua"
from the ListView
definition in the MainWindow...