Try running the C # Prism WPF official sample (.NET Core version)

5 minute read

I tried running Official Prism Samples.
It’s hard to get an image just by looking at the source, so caption the screen.

Operating environment

Windows 10
Microsoft Visual Studio Community 2019

01-BootstrapperShell

Create a basic bootstrap and shell

Topic : Bootstrapper and the Shell
Description : Create a basic bootstrapper and shell

image.png

image.png

02-Regions

Create a region

Topic : Regions
Description : Create a region
image.png

image.png

03-CustomRegions

Create a Custom Region Adapter for StackPanel

Topic : Custom Region Adapter
Description : Create a custom region adapter for the StackPanel

image.png

image.png

04-ViewDiscovery

View is automatically injected with View Discovery

Topic : View Discovery
Description : Automatically inject views with View Discovery

image.png

image.png

05-ViewInjection

Manually add and remove views using view injection

Topic : View Injection
Description : Manually add and remove views using View Injection

image.png

image.png

Click the [Add View] button
image.png

06-ViewActivationDeactivation

Manually activate and deactivate the view

Topic : View Activation/Deactivation
Description : Manually activate and deactivate views

image.png

image.png

Click the [Deactivate View] button
image.png

When you click the [Activate View B] button
image.png

Click the [Deactivate View] button
image.png

07-Modules - AppConfig

Load the module using the App.config file

Topic : Modules with App.config
Description : Load modules using an App.config file

image.png

image.png

07-Modules - Code

Load the module using code

Topic : Modules with Code
Description : Load modules using code

image.png

image.png

07-Modules - Directory

Load the module from the directory

Topic : Modules with Directory
Description : Load modules from a directory

image.png

image.png

07-Modules - LoadManual

Manually load the module using IModuleManager

Topic : Modules loaded manually
Description : Load modules manually using the IModuleManager

image.png

image.png

Click the [Load Module] button
image.png

08-ViewModelLocator

Using ViewModelLocator

Topic : ViewModelLocator

Description : using the ViewModelLocator
image.png

image.png

09-ChangeConvention

Change the ViewModelLocator naming convention

Topic : ViewModelLocator - Change Convention
Description : Change the ViewModelLocator naming conventions

image.png

image.png

10-CustomRegistrations

Manually register the ViewModel for a particular view

Topic : ViewModelLocator - Custom Registrations
Description : Manually register ViewModels for specific views

image.png

image.png

11-UsingDelegateCommands

Use DelegateCommand and DelegateCommand

Topic : DelegateCommand
Description : Use DelegateCommand and DelegateCommand

image.png

image.png

If you check [Can Execute Command]
image.png

12-UsingCompositeCommands

Learn how to use Composite Commands to call multiple commands as a single command

Topic : CompositeCommands
Description : Learn how to use CompositeCommands to invoke multiple commands as a single command

image.png

image.png

When [Can Execute] is unchecked
image.png

If you select [Tab B]
image.png

13-IActiveAwareCommands

Activate the command and call only the active command

Topic : IActiveAware Commands
Description : Make your commands IActiveAware to invoke only the active command

image.png

image.png

When [Can Execute] is unchecked
image.png

If you select [Tab B]
image.png

14-UsingEventAggregator

Using IEventAggregator

Topic : Event Aggregator
Description : Using the IEventAggregator

image.png

image.png

Click the [Send Message] button
image.png

15-FilteringEvents

Event filtering when subscribing to events

Topic : Event Aggregator - Filter Events
Description : Filtering events when subscribing to events

image.png

image.png

No change is seen when clicking the Send Message button

16-RegionContext

Pass data to nested regions using RegionContext

Topic : RegionContext
Description : Pass data to nested regions using the RegionContext

image.png

image.png

When you select a row in the ListBox
image.png

17-BasicRegionNavigation

See how to implement basic region navigation

Topic : Region Navigation
Description : See how to implement basic region navigation

image.png

image.png

When you click the [Navigate to View A] button
image.png

When you click the [Navigate to View B] button
image.png

18-NavigationCallback

Get notified when navigation is complete

Topic : Navigation Callback
Description : Get notifications when navigation has completed

image.png

image.png

When you click the [Navigate to View A] button
image.png

When you click the [Navigate to View B] button
image.png

19-NavigationParticipation

Learn about INavigationAware’s participation in View and ViewModel navigation

Topic : Navigation Participation
Description : Learn about View and ViewModel navigation participation with INavigationAware

image.png

image.png

When you click the [Navigate to View A] button
image.png

Click the [Navigate to View A] button again
image.png

When you click the [Navigate to View B] button
image.png

20-NavigateToExistingViews

Control view instances during navigation

Topic : Navigate to existing Views
Description : Control view instances during navigation

image.png

image.png

When you click the [Navigate to View A] button
image.png

Click the [Navigate to View A] button again
image.png

When you click the [Navigate to View B] button
image.png

21-PassingParameters

Pass parameters from View / ViewModel to another View / ViewModel

Topic : Passing Parameters
Description : Pass parameters from View/ViewModel to another View/ViewModel

image.png

image.png

When you select a row in the ListBox
image.png

If you select another row in the ListBox
image.png

22-ConfirmCancelNavigation

Use the interface to check or cancel navigation

Topic : Confirm/cancel Navigation
Description : Use the IConfirmNavigationReqest interface to confirm or cancel navigation

image.png

image.png

When you click the [Navigate to View A] button
image.png

When you click the [Navigate to View B] button
image.png

Click [Yes]
image.png

23-RegionMemberLifetime

IRegionMemberLifetime automatically deletes views from memory

Topic : Controlling View lifetime
Description : Automatically remove views from memory with IRegionMemberLifetime

image.png

image.png

When you click the [Navigate to View A] button
image.png

When you click the [Navigate to View B] button
image.png

24-NavigationJournal

Learn how to use navigation journals

Topic : Navigation Journal
Description : Learn how to use the Navigation Journal

image.png

image.png

When you select a row in the ListBox
image.png

When you click the [Go Back] button
image.png

25-NotificationRequest

Learn how to display pop-ups using InteractionRequest

Topic : Interactivity - NotificationRequest
Description : Learn how to show popups using an InteractionRequest

image.png

image.png

Click the Raise Default Notification button
image.png

Click OK
image.png

26-ConfirmationRequest

Learn how to display a confirmation dialog using ConfirmationRequest

Topic : Interactivity - ConfirmationRequest
Description : Learn how to prompt a confirmation dialog using a ConfirmationRequest

image.png

image.png

Click the Raise Default Notification button
image.png

Click OK
image.png

Click the Raise Default Confirmation button
image.png

Click OK
image.png

27-CustomContent

Learn how to use your own content for dialogs displayed in Interaction Request

Topic : Interactivity - Custom Content
Description : Learn how to use your own content for a dialog shown with InteractionRequest

image.png

image.png

Click the Raise Default Notification button
image.png

Click OK
image.png

Click the Raise Default Confirmation button
image.png

Click OK
image.png

Click the Raise Custom Popup button
image.png

Click [Accept]
image.png

28-CustomRequest

Create your own custom request for use with Interaction Request

Topic : Interactivity - Custom Request
Description : Create your own custom request to use with an InteractionRequest

image.png

image.png

Click the Raise Default Notification button
image.png

Click OK
image.png

Click the Raise Default Confirmation button
image.png

Click OK
image.png

Click the Raise Custom Popup button
image.png

Click [Accept]
image.png

Click the Raise Custom Interaction button
image.png

When you select an Item from the ListBox and click the [Select Item] button
image.png

29-InvokeCommandAction

Call a command in response to any event

Topic : Interactivity - InvokeCommandAction
Description : Invoke commands in response to any event

image.png

image.png

When you select a row from the ListBox
image.png