What is .NET MAUI? —— a cross-platform framework for creating native mobile and desktop apps with C# and XAML.

https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui?view=net-maui-7.0

 

.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML.

 

Using .NET MAUI, you can develop apps that can run on Android, iOS, macOS, and Windows from a single shared code-base.

 

 

 

.NET MAUI is for developers who want to:

  • Write cross-platform apps in XAML and C#, from a single shared code-base in Visual Studio.
  • Share UI layout and design across platforms.
  • Share code, tests, and business logic across platforms.

 

 

.NET MAUI unifies Android, iOS, macOS, and Windows APIs into a single API that allows a write-once run-anywhere developer experience, while additionally providing deep access to every aspect of each native platform.

 

https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-7.0&tabs=vswin

 

 https://learn.microsoft.com/en-us/dotnet/maui/get-started/first-app?view=net-maui-7.0&tabs=vswin&pivots=devices-android

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 UI: XAML

https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/?view=net-maui-7.0

 

 

 

 ui 渲染无法立即展示

 

hot reload: 热加载。 UI变化之后,运行时的页面 会自动重载

 

 

数据绑定:

双向数据绑定

=》 数据联动

 

https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/data-binding/?view=net-maui-7.0

 

how?

1.  定义 用于binding的属性 =》 属性改变,发送通知: INotificationPropertyChanged, ObservableCollection

2.  设置绑定

3. 设置绑定的 上下文(if 自身未设置, then 找父级:继承)

 

command binding

https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/data-binding/commanding?view=net-maui-7.0

 

 

MVVM

https://learn.microsoft.com/en-us/dotnet/maui/tutorials/notes-mvvm/?view=net-maui-7.0

1. view model 定义(继承自 ViewModelBase)

2. 设置 binding上下文

3. 接口注册

 

导航:

1. 路由注册

2. shell go to async

https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/?view=net-maui-7.0

 

web 服务的交互:

https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/rest?view=net-maui-7.0

 

数据存储:

https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/database-sqlite?view=net-maui-7.0

preferences的设置(首选)

https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/preferences?view=net-maui-7.0&tabs=windows

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2023-03-20 16:19  PanPan003  阅读(39)  评论(0编辑  收藏  举报