Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Issue in DelayedRegionCreationBehavior/PrismCode when region name for target element is null

$
0
0
I have come across this issue while working with WPF application using prism. I got to know what the error was, but couldn't find out why was this error and when can the region be null for any object. Want to know how such issues can be handled in the application so that they do not occur again.

Details of the issue:

The cause of this issue was that some code in the application called Microsoft.Practices.Prism.Regions.Behaviors.DelayedRegionCreationBehavior.CreateRegion(System.Windows.DependencyObject, System.String), but supplied a null for the String argument, which appears to be the "regionName".

While creating region, the prism code is trying to get RegionName from the dependency object which is a null value and because of this the Initialize method is throwing ArgumentNull exception.

Exception:

The most likely causing exception was: 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Practices.Prism.Regions.Behaviors.RegionCreationException: An exception occurred while creating a region with name ''. The exception was: System.ArgumentNullException: Value cannot be null.
Parameter name: regionName
at Microsoft.Practices.Prism.Regions.RegionAdapterBase1.Initialize(T regionTarget, String regionName)
at Microsoft.Practices.Prism.Regions.RegionAdapterBase
1.Microsoft.Practices.Prism.Regions.IRegionAdapter.Initialize(Object regionTarget, String regionName)
at Microsoft.Practices.Prism.Regions.Behaviors.DelayedRegionCreationBehavior.CreateRegion(DependencyObject targetElement, String regionName). ---> System.ArgumentNullException: Value cannot be null.

Viewing all articles
Browse latest Browse all 1878

Trending Articles