views:

43

answers:

3

I really need some more ideas as to what's causing this, currently it's driving me up the wall.

I have a Xaml user control which contains another user control like this :


<UserControl x:Class="MyModule.View.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:igDock="http://infragistics.com/DockManager"
    xmlns:views="clr-namespace:MyModule.View"
    >
  <StackPanel x:Name="panel">
    <views:MyHeaderView/>
    <igDock:XamDockManager x:Name="dockingManager"/>
  </StackPanel>
</UserControl>

This is within a Prism module (hence the MyModule name), but otherwise I don't think this is anything particularly unusual.

Now, as soon as I add a name to the header view the code fails to compile, e.g.

<views:MyHeaderView x:Name="header"/>

The error I get back is simply :

"The type name 'View' does not exist in the type MyModule.MyModule'"

I've tried moving the contained user control into another namespace, creating a blank user control and trying with that (same result) and removing the XamDockManager, but nothing seems to make any difference.

Can anyone shed any light on this?

A: 

Could it be that you have class that is named "View", same as namespace?

zendar
Nope, no classes named View, at least none of my classes are.
adhocgeek
+1  A: 

I think I found the answer.

If I rename the module class to MyModuleThingy, then it compiles. It seems the problem arises because the module class has the same name as the namespace which contains it (MyModule.MyModule).

If anyone can let me know why that might be a problem, I'd be very interested to know. Particularly because I've inherited a lot of code where that seems to be the common pattern within this particular implementation of Prism.

adhocgeek
A: 
Mark Shurmer