IModuleCatalog Error

Topics: Prism v4 - Silverlight 4
Aug 11, 2010 at 1:30 PM
Edited Aug 11, 2010 at 1:31 PM

I am trying to extend ModuleInfo so I can store more metadata against a module, such as icon, title, desctiption etc. I have extended ModuleInfo accordingly...

 

namespace Business.Apps.Dashboard.Modules
{
    /// <summary>
    /// 
    /// </summary>
    public class WidgetInfo : ModuleInfo
    {
        /// <summary>
        /// Gets or sets the icon URI.
        /// </summary>
        /// <value>The icon URI.</value>
        public string IconUri { get; set; }

    }
}

 

however whenever the ModuleCatalog tries to read my config from XAML, it throws a XAMLParseException...

The type 'WidgetInfo' was not found because 'clr-namespace:Business.Apps.Dashboard.Modules' is an unknown namespace. 

Any ideas what this is?

The root tag for my module catalog looks like this...

 

<Modularity:ModuleCatalog xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                          xmlns:Modularity="clr-namespace:Microsoft.Practices.Composite.Modularity;assembly=Microsoft.Practices.Composite" 
                          xmlns:local="clr-namespace:IE.Business.Apps.Dashboard.Modules">

 

Aug 13, 2010 at 7:13 PM

Hi,

Based on the namespace and the ModuleCatalog.xaml you shared, the problem seems to be the namespace specified, since the project name and namespace are different. I tried using the following xaml and it worked:

<Modularity:ModuleCatalog xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                          xmlns:sys="clr-namespace:System;assembly=mscorlib" 
                          xmlns:Modularity="clr-namespace:Microsoft.Practices.Composite.Modularity;assembly=Microsoft.Practices.Composite"
                          xmlns:local="clr-namespace:Business.Apps.Dashboard.Modules;assembly=IE.Business.Apps.Dashboard.Modules" >

Please let me know if this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero

Aug 13, 2010 at 7:50 PM

Thats it - thanks. It would appear you have to specify the assembly regardless.

Jan 7, 2011 at 6:18 PM

@mcampster I am trying to incorporate icon and title information for my modules as well. Would you mind posting some more code to show how you are achieving this in your app?