NameSpaceMapping

Topics: Getting Started
Oct 4, 2012 at 1:33 PM

Hey

I have read in the Forum, but didn't find an answer, which is the right for me.

I have 2 Projects, the main Project is called: OPT_Studio and the second one is called ISViewModel

So, in the OPT_Studio Project, there I want to have all my Views and (like the Project is called) in the ISViewModel, I want to hold my ViewModels.

I found the Namespace Convension article. and played around with it. - Till yet...
I use VB.NET!!!

I added the following code:

  Protected Overrides Sub Configure()
        MyBase.Configure()

        Caliburn.Micro.ViewLocator.AddNamespaceMapping("ISViewModel.MainWindow", "OPT_Studio.MainWindow")
        Dim TypeName As String = "ISViewModel.MainWindow.HauptmenueViewModel"
        Debug.Print([String].Join(", ", Caliburn.Micro.ViewLocator.TransformName(TypeName, Nothing).ToArray()))

    End Sub

The Output of the Debug.Print =

OPT_Studio.MainWindow.HauptmenueView, ISViewModel.MainWindow.HauptmenueView

So, I think, this would be correct. - When the view is searched in the OPT_Studio.MainWindow Namespace

But it isn't working - I still get an empty Window with:

Cannont find view for ISViewModel.MainWindow.HauptmenueViewModel

What am I doing wrong!? - THX for any help!

Oct 5, 2012 at 8:44 AM

Did you override the SelectAssemblies() method of the bootstrapper so that both assemblies are returned?

Oct 5, 2012 at 8:49 AM

Hey

Yes, I did it. - But I found the Problem a few minutes ago. -> I have forgotten to Name the "Hauptmenue"=>"HauptmenueView"

Such things make me crazy. -> Searching, searching....

But THX anyway!

Have a nice day