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

Chapter 4 An Architecture to Suit You

///<summary>Executes the logic for when <see cref="Time"/> is changing.</summary> [global::System.CodeDom.Compiler. GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators. ObservablePropertyGenerator", "8.0.0.0")]

partial void OnTimeChanging(global::System. DateTime value);

///<summary>Executes the logic for when <see cref="Time"/> just changed.</summary> [global::System.CodeDom.Compiler. GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators. ObservablePropertyGenerator", "8.0.0.0")]

partial void OnTimeChanged(global::System. DateTime value);

}

}

You can see that the generated source code looks a little noisy, but it does in fact generate the property you need. View the section highlighted in bold above.

I have only really scratched the surface regarding the functionality that the CommunityToolkit.Mvvm offers. I strongly urge you to refer to the documentation at https://learn.microsoft.com/dotnet/

communitytoolkit/mvvm/ to learn how it can further aid your application development.

Summary

I hope I have made it clear that there is no single right way to do things or build applications. You should pick and choose what approaches will best suit your environment. With this point in mind, the goal of this chapter was to give you a good overview of several different approaches to architecting

105

Chapter 4 An Architecture to Suit You

your application. There are always a lot of opinions floating around to indicate which architectures people prefer but I strongly urge you to evaluate which will help you to achieve your goals best.

In this chapter, you have

•\

Learned about the different possibilities you have to

 

architect your applications

•\

Decided on what architecture to use

•\

Walked through a concrete example by creating the

 

ClockWidget

•\

Learned how to further optimize your implementation

 

using NuGet packages

In the next chapter, you will

•\

Create and apply an icon in your application

•\

Add some placeholder pages and view models

•\

Fill your first page with some UI and set up bindings to

 

the view model

•\

Explore data binding and its many uses

•\

Gain an understanding of XAML

•\

Learn about the possible layouts you can use to group

 

other controls

•\

Gain an understanding of Shell and apply this to

 

building your application’s structure

•\

Apply the Shell navigation to allow you to navigate

•\

Build your flyout menu

106

Chapter 4 An Architecture to Suit You

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/ch04.

107

PART II

User Interface