Click here to Skip to main content
15,886,806 members
Home / Discussions / C#
   

C#

 
QuestionAnother conversion problem (Prism) Pin
Andy_L_J18-Nov-12 11:07
Andy_L_J18-Nov-12 11:07 
I am using Prism to handle IoC, I can do this in VB.NET:

VB"
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:
C#
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

AnswerRe: Another conversion problem (Prism) Pin
Pete O'Hanlon18-Nov-12 11:39
mvePete O'Hanlon18-Nov-12 11:39 
GeneralRe: Another conversion problem (Prism) Pin
Andy_L_J18-Nov-12 11:47
Andy_L_J18-Nov-12 11:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.