Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

Chapter 8 Advanced UI Concepts

Source Code

The resulting source code for this chapter can be found on the GitHub repository at https://github.com/Apress/Introducing-MAUI/tree/ main/ch08.

Extra Assignment

I think you can take these animations to another level and really make your application feel alive! Try the following possible extensions!

Animate the BoxView Overlay

You’ve added an animation to present your Border with the widget selection details inside. A nice further enhancement on this would be to also animate the BoxView that you are using as your semi-transparent

overlay. I personally think a nice FadeTo animation would work well but I would love to hear what works best for you.

Animate the New Widget

To really make the application feel alive, you could consider animating each widget as it is added onto the board. You have the Widgets_ ChildAdded method inside your BoardLayout.xaml.cs file where you set the Position. You could consider expanding this method implementation to also animate the new widget. Perhaps you could make the new widget scale up similar to how your Border presents.

255

PART III

Behind the Scenes

CHAPTER 9

Local Data

In this chapter, you will learn about the different types of local data, what they are best used for, and how to apply them in your application. The options will include understanding when and where to store data that needs to be kept secure.

You will modify your application to store the boards that your user creates so that they can be displayed in the slide-out menu and also be opened. You will also record the last opened board so that when returning to the application this board will be presented to the user.

What Is Local Data?

When building an application, whether it is targeted for a single or multiple platforms, you will very likely need to store some data about the state of the application. The types of data you will need to store can vary between storing “simple” settings, caching files/data, or even storing a full set of data inside a local database. These types of data are called local data since they live on the device that your application is running on. Data that comes from a remote endpoint is called remote data and this will be covered in Chapter 10.

.NET MAUI provides multiple options when you want to store data locally on a device. Each option is better suited to a specific purpose and size of data. Here is a brief overview of those options:

© Shaun Lawrence 2023

259

S. Lawrence, Introducing .NET MAUI, https://doi.org/10.1007/978-1-4842-9234-1_9