11. What is ILoggerFacade?
ILoggerFacade is an interface used in Prism Framework for logging purpose.
The simplest approach to logging in Prism is to override the
LoggerFacade property in your Bootstrapper. By overridding the
LoggerFacade, you can pass in an instance of any Logger you want with any configuration needed as long as the logger implements the
A simple Example is given below.
class Log4NetLogger : ILoggerFacade
// Member variables
private readonly ILog m_Logger = LogManager.GetLogger(typeof(Log4NetLogger));
#region ILoggerFacade Members
/// Writes a log message.
/// <param name=”message”>The message to write.</param>
/// <param name=”category”>The message category.</param>
/// <param name=”priority”>Not used by Log4Net; pass Priority.None.</param>
public void Log(string message, Category category, Priority priority)
12. What are Region and Region Managers?
In Prism framework, we define the region through XAML code and once a region is defined, automatically it will be registered with the RegionManager. Actually the Bootstrapper registers a service called the RegionManager at run time.
RegionManager is a dictionary where the key is name of the region. The value of the key is the reference of the IRegion interface. RegionAdapter is used to create the instance reference of the IRegion interface.
13. What are MEF and Unity?
Unity is mostly used for static dependencies and is more an “internal” technology, meaning outsiders do not need to know that unity is being used in the application. Unity is a IOC container. Use it to make your app more loosely coupled.
The MEF (Managed Extensibility Framework) is the new concept in .net 4.0. It is used to create the lightweight and extensible applications to create Managed Extensibility Framework. It is not only allows the extension but also reused within the application.
MEF should be used for dynamic dependencies, it is great at dynamically loading components and with the use of attributes it make creating application extensions or an application that can be extended by others easy and streamlined.
14. Does MEF create singleton instance of objects by default?
Yes, MEF creates singleton instance by default.
15. What attribute should be added so that MEF does not create singleton instance?
Add below attribute to indicate that the created instance is not shared.
16. How to navigate to another page in WPF?
There is a class NavigationService which can be used for navigation of the WPF window:
17. How Prism combines individual units into a single unit?
PRISM uses dependency injection for the same.
Dependency Injection can be done by two way’s by using unity application block or MEF ( managed extensibility framework).
18. Does PRISM support MVVM?/Does PRISM do MVVM?
Although the prime focus of PRISM is modular development.
But PRISM does have ready made classes like delegate command which can help reduce MVVM code.
But please note that PRISM’s main goal of is not MVVM.
19. What are the different Navigations in PRISM?
In PRISM “Navigation” is defined as the process by which the application coordinates changes to its User Interface.
Prism provides the two styles of navigation:
- State-Based Navigation : Accomplished by state changes to existing controls in the visual tree.
- View-Based Navigation : Accomplished by the addition or removal of elements from the visual tree.
20. When to use State-Based navigation?
State-Based navigation is suitable in the following situations:
- The view needs to display the same data or functionality in different styles or formats.
- The view needs to change its layout or style based on the underlying state of the view model.
- The view needs to initiate limited modal or non-modal interaction with the user within the context of the view.
Quick Reference :
learn more on Prism visit following links