Introduction
The content brought to you this time is an example of multi-module collaboration based on NCF. The main content of today's article is the ability of the NCF modules Xncf to call and cooperate with each other.
Xncf can be compared to Lego, an Xncf is the type of Lego you have, for example you have a set of Lego to build a house, and you have a set of Lego to build a plane and a car. The collaboration of so many modules is like building a part with toys that build a house. If you want to build a garage in the house, and then put the built car in the car Lego set directly into the garage of the house, it matches exactly , no will not feel out of place, because their specifications are consistent.
step
- Overview of NCF
- NCF installation process
- NCF Docs
- Demonstration of the NCF Runtime Module
- Demonstration of the NCF interface in action
- Demonstration of the NCF case
- Management of modules under different modules of NCF
- Increase of interfaces under different modules of NCF
- Mutual calls under different modules of NCF
- A brief introduction to MAUI
- Running installation of MAUI
- Demo of NCF combined with MAUI
implement
▌NCF overview
About the overview of NCF, we have already talked about it in many chapters. For details, please go to: About NCF .
▌NCF installation process
For the NCF installation process, please go to: NCF First Run Installation
▌NCF Docs
Official documentation: Docs
▌Demo of NCF running module
After running and logging in successfully, you will see that the module management under the extension module contains many new modules discovered.
Click to install the module, it will display whether the module needs to be turned on, after turning on, all the functions of the module will be enabled.
▌Demo of NCF interface operation
We display the interface of the web api through the visual Swagger plug-in
After the interface call is completed, the data format returned by the interface is displayed, and you can place it on the application you need as needed.
▌ Demonstration of NCF case
This case is a small case made by us. If you are interested in the experience, you can search for "Yanhuan" in the WeChat applet (hint: registration of personal information is required, please choose by yourself). This applet is completely made with NCF.
▌Management of modules under different modules of NCF
Today's focus is here, multiple different modules are installed into the project at the same time
As you can see in the above picture, the installed modules contain 2 modules, one is the platform management module and the other is the DotnetDay module
From the code structure in the project, it looks like this
The actual situation displayed by the backend is like this
Click to add a new product, you can see the form information of the new product
There is an edit operation at the end of each line, click to pop up the edit form page
▌Increase of interfaces under different modules of NCF
This is the interface of the platform management open v1 version
This is the interface for v3 of the DotnetDay module
▌ Mutual calls under different modules of NCF
Let's take the uploaded pictures of new products as an example. We use the product management module under the DotnetDay module to call the v1 interface under [Platform Management] to prove whether the mutual calls between modules are successful.
The above picture shows the result of the call. We see that the upload call is the v1 interface upload, which means that the [DotnetDay module] and the [platform module] have called each other, and it is successful.
To sum up, Xncf gives developers great possibilities, allowing you to code, write applications, and write functions in your own way.
▌A brief introduction to MAUI
.NET Multiplatform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps using C# and XAML.
Using .NET MAUI, you can develop apps that run on Android, iOS, macOS, and Windows in a single shared code base.
.NET MAUI is open source and an evolution of Xamarin.Forms, extending from mobile to desktop scenarios, with UI controls regenerated from scratch for performance and scalability. If you've used Xamarin.Forms to generate cross-platform user interfaces before, you'll notice many similarities with .NET MAUI. But there are some differences. With .NET MAUI, you can create multi-platform apps with a single project, but add platform-specific source code and resources if necessary. The main goal of .NET MAUI is to implement as much application logic and UI layout as possible in a single codebase.
▌MAUI running installation
Before installing MAUI, dotnet 7 preview must be installed, otherwise there is no way to run successfully
Here I choose the Windows operating platform! [](/img/bVc0Hus)
Of course, he also supports Android, IOS emulators, etc.
If you don't have an Android emulator yet, you can try to create a new one
Add the device specs you want
After adding, it shows
Running the show
▌NCF combined with MAUI Demo
We combine NCF and MAUI to show the list function of the product
A new button to enter the application has been added to MAUI. After clicking, it will enter the page of the product list. When the data in the product management of NCF changes
After entering the application in MAUI, the following content will be displayed, thus realizing the combination of MAUI and NCF
There are many more interesting functions, I hope to explore the future of NCF with you...
References
- NCF's warehouse address: https://github.com/NeuCharFramework/NCF
- NCF Doc warehouse address: https://github.com/NeuCharFramework/NcfDocs
Microsoft Most Valuable Professional (MVP)
The Microsoft Most Valuable Professional is a global award given to third-party technology professionals by Microsoft Corporation. For 29 years, technology community leaders around the world have received this award for sharing their expertise and experience in technology communities both online and offline.
MVPs are a carefully selected team of experts who represent the most skilled and intelligent people, passionate and helpful experts who are deeply invested in the community. MVP is committed to helping others and maximizing the use of Microsoft technologies by Microsoft technical community users by speaking, forum Q&A, creating websites, writing blogs, sharing videos, open source projects, organizing conferences, etc.
For more details, please visit the official website:
https://mvp.microsoft.com/en-us
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。