Label is used to display single-line or multi-line text. It can display text with a certain format, such as color, space, text decorations, and even HTML text. To create a Label, we can use the simplest format, like so:
<Label Text="Hello world" />
In the user interface design, we usually use icons to decorate other controls or display images as backgrounds. The Image control can display an image from a local file, a URI, an embedded resource, or a stream. The following code shows an example of how to create an Image control in the simplest form:
<Image Source="dotnet_bot.png" />
In our app, the users need to enter or edit a single line of text or multiple lines of text. We have two controls to serve this purpose: Editor and Entry.
Editor can be used to enter or edit multiple lines of text. The following is an example of the Editor control:
<Editor Placeholder="Enter your description here" />
Entry can be used to enter or edit a single line of text. To design a login page, we can use Entry controls to enter a username and password. When users interact with an Entry, the behavior of the keyboard can be customized through the Keyboard property. When users enter their passwords, the IsPassword property can be set to reflect the typical behavior on a login page. The following is an example of a password entry:
<Entry Placeholder="Enter your password" Keyboard="Text" IsPassword="True" />
In the user interface design, a common use case is to display a collection of data. In .NET MAUI, a few controls can be used to display a collection of data, such as CollectionView, ListView, and CarouselView. In our app, we will use ListView to display password entries, groups, and the content of an entry. We will introduce the usage of ListView when we introduce ItemsPage.