locked
Help! Can't create new UserControls in Blend 4 RRS feed

  • Question

  • I've been working with a project for 2 days now, and for some reason, starting this afternoon, I am no longer able to add new user controls. 

    Following these steps:

    1. In Blend, right click in the project window and select "add new item"

    2. Choose "UserControl" and give it a custom name

    3. Do anything (or nothing for that matter) at all to style the UserControl.  For this example I'll just add a red rectangle.

    4. Build the project.

    5. The UserControl is not available in the project. 

    I can find all 10 of the previously created UserControls for the project. But new controls do not show up.

    If I add the new control manually in XAML it will break the build.  

    The only thing new about the project today is that I finally added it to Source control. 

    Any help is appreciated.

    Thanks

    Tuesday, March 15, 2011 6:01 PM

Answers

  • Okay. I finally got back to this after some time to clear the head.

    Looks like the problem was that the namespace was not declared in the app.xaml file.

    To this code:

    <Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="MyProject.App">


     

    I added this:

    xmlns:local="clr-namespace:MoAd_Online_Handbook"

    And it's working just fine now. 

    Wednesday, March 16, 2011 1:10 AM

All replies

  • Update:  I am able to get my new UserControl to work by designing from within VisualStudio, and I can build & run the project perfectly.  It's only in blend where I get  "filename.xaml contains types that cannot be resolved." and the design view is unavailable.

    Tuesday, March 15, 2011 7:57 PM
  • Okay. I finally got back to this after some time to clear the head.

    Looks like the problem was that the namespace was not declared in the app.xaml file.

    To this code:

    <Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="MyProject.App">


     

    I added this:

    xmlns:local="clr-namespace:MoAd_Online_Handbook"

    And it's working just fine now. 

    Wednesday, March 16, 2011 1:10 AM
  • Hey

    I am having the same problem, But I dont understand your solution.

    what is MoAd_Online_Handbook?

     

    Thanks@

    Tuesday, December 6, 2011 4:11 AM