Prism: Framework Introduction and Installation
What is Prism?
Prism is a framework for building loosely coupled, maintainable and testable XAML applications in WPF, Xamarin Form, Uno Platform and WinUI.
Github
/PrismLibrary/Prism
NuGet
/packages/
VS2022 Expansion
Features: MVVM, dependency injection, regions, navigation, modules, dialogs, publish and subscribe.
Manually created
1. Create a .NetFramework program or .
2. Installation in Nuget (note the version number)
3. Modify the file, add prism namespace, inherited from Application->PrismApplication, as follows.
Open the file, inherited from Application->PrismApplication, as follows.
Implement the abstract class as follows:
Here, we implement two of these abstract methods.
This method returns a window of type Window, which is actually the main window of the application.
This method is used during the initialization of Prism to define some of our own needs.enrollmenttype, so that it can be used in Prism.
Start the program:
Two forms appear, just delete the StartupUri in it.
autocreate
After installing the expansion pack, you can choose to create an empty template.The default is .netCore and the Prism package is also version 8.1.97