演示如何在WPF中使用各种Prism功能的示例。如果您刚开始使用Prism,建议您从第一个示例开始,然后按顺序(按顺序)从列表中移出。每个样本都基于先前样本的概念。演示如何在WPF中使用各种Prism功能的示例。如果您刚开始使用Prism,建议您从第一个示例开始,然后按顺序(按顺序)从列表中移出。每个样本都基于先前样本的概念。
官方例子是使用Prism.Unity,VS2019 ,本文中的例子是使用Prism.DryIOC,VS2017,.net4.8,希望对大家学习Prism有所帮助。
github地址
TopicDescriptionBootstrapper and the ShellCreate a basic bootstrapper and shellRegionsCreate a regionCustom Region AdapterCreate a custom region adapter for the StackPanelView DiscoveryAutomatically inject views with View DiscoveryView InjectionManually add and remove views using View InjectionView Activation/DeactivationManually activate and deactivate viewsModules with App.configLoad modules using an App.config fileModules with CodeLoad modules using codeModules with DirectoryLoad modules from a directoryModules loaded manuallyLoad modules manually using the IModuleManagerViewModelLocatorusing the ViewModelLocatorViewModelLocator - Change ConventionChange the ViewModelLocator naming conventionsViewModelLocator - Custom RegistrationsManually register ViewModels for specific viewsDelegateCommandUse DelegateCommand andDelegateCommand
CompositeCommandsLearn how to use CompositeCommands to invoke multiple commands as a single commandIActiveAware CommandsMake your commands IActiveAware to invoke only the active commandEvent AggregatorUsing the IEventAggregatorEvent Aggregator - Filter EventsFiltering events when subscribing to eventsRegionContextPass data to nested regions using the RegionContextRegion NavigationSee how to implement basic region navigationNavigation CallbackGet notifications when navigation has completedNavigation ParticipationLearn about View and ViewModel navigation participation with INavigationAwareNavigate to existing ViewsControl view instances during navigationPassing ParametersPass parameters from View/ViewModel to another View/ViewModelConfirm/cancel NavigationUse the IConfirmNavigationReqest interface to confirm or cancel navigationControlling View lifetimeAutomatically remove views from memory with IRegionMemberLifetimeNavigation JournalLearn how to use the Navigation JournalInteractivity - NotificationRequestLearn how to show popups using an InteractionRequestInteractivity - ConfirmationRequestLearn how to prompt a confirmation dialog using a ConfirmationRequestInteractivity - Custom ContentLearn how to use your own content for a dialog shown with InteractionRequestInteractivity - Custom RequestCreate your own custom request to use with an InteractionRequestInteractivity - InvokeCommandActionInvoke commands in response to any event