|
I am using Prism to handle IoC, I can do this in VB.NET:
Dim _regionManager As IRegion
Dim _container As IUnityContainer
...
Dim mainRegion As IRegion = _regionManager.Regions(RegionNames.MainRegion)
For Each v As View In mainRegion.Views
mainRegion.Remove(v)
Next
_regionManager.RegisterViewWithRegion(RegionNames.MainRegion, GetType(MaterialView)
I am getting the following eror: non-invocable member ....Regions cannot be used as a method.
When I use this C# conversion:
IRegion mainRegion = _regionManager.Regions(RegionNames.MainRegion);
for each(var v in mainRegion.Views)
{
mainRegion.Remove(v);
}
_regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof(MaterialView));
Some hints as to why would be very helpfull.
I don't speak Idiot - please talk slowly and clearly
"I have sexdaily. I mean dyslexia. Fcuk!"
Driven to the arms of Heineken by the wife
|
|
|
|
|
Regions is a collection. You access this using the indexer operator [..] , so that would be _regionManager.Regions[RegionNames.MainRegion];
|
|
|
|
|
Hi Pete, thanks for the help. I should have remembered this as I had the same issue a few days ago accessing the fields in a Datarow!
I don't speak Idiot - please talk slowly and clearly
"I have sexdaily. I mean dyslexia. Fcuk!"
Driven to the arms of Heineken by the wife
|
|
|
|