Click here to Skip to main content
11,645,087 members (65,080 online)
   

C#

 
QuestionAnother conversion problem (Prism) Pin
Andy_L_J18-Nov-12 11:07
memberAndy_L_J18-Nov-12 11:07 
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

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

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 3 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid