1

I have one assembly XAML registered in AssemblyInfo.cs:

[assembly: XmlnsDefinition("http://schemas.mysite.es/wpf", "SWC.ViewModels")] 

And In my namespace I hace these classes:

namespace SWC.ViewModels { public class MenuViewModel : ObservableCollection<MenuViewModel> { public MenuViewModel() : base() { } } } 

If I use the namespace in a user control XAML,

<UserControl x:Class="SWC.UserControls.UserMenu" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:customMenu="http://schemas.mysite.es/wpf"> 

I can use the class in my XMLNS namespace,

<UserControl.Resources> <customMenu:MenuViewModel x:Key="MenuItemsSource"> 

But, when I execute the application, the compiler said

The label 'MenuViewModel' dosen't exist in the namespace XML 'http://schemas.mysite.es/wpf' 

All, can help me?? I'm crazy with this problem!! Best regards,

1
  • Welcome to Stack Overflow! A formatting tip: to get code blocks, prefix each line with four spaces, or click on the {} button. Commented Dec 29, 2010 at 7:16

1 Answer 1

1

I think you need to specify the assembly in which your customMenu controls exist. The assembly must also be referenced from the project (in the References section).

xmlns:customMenu="clr-namespace:customMenuNamespace;assembly=customMenuLibrary" 

Otherwise I don't see how the compiler can find your implementation only through "http://schemas.mysite.es/wpf". What's at that address? The two microsoft schemas

http://schemas.microsoft.com/winfx/2006/xaml/presentation http://http://schemas.microsoft.com/winfx/2006/xaml 

work like some identifiers for the xaml compiler, there is nothing at those addresses.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.