Search code examples
wpfexpression-blendblendexpression-blend-3

Blend 3 in design time can't find my converters/Resources .(WPF)


I'm having troubles using Blend with my visual studio solution.

In Runtime, and compile time everything is just fine.

As you can see in the picture, Blend urges me to Build the project, but it does not change the situation, even after a successful build, rebuild, clean & build, it is still the same, the UI is blocked from the designer

Any ideas?

alt text

EDIT: Typos fixed, problem persists.

Converter code:

namespace BlendTest
{
    public class TestConvert : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return ((bool)value) ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }  
}      



<Window
  x:Class="XP2Win7.UserInterface.ImageViewer.MainView.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:BlendTest"
  WindowState="Maximized"
  WindowStartupLocation="CenterScreen"
  Background="Transparent"
  Title="Test">
    <Window.Resources>
        <local:TestConvert x:Key="TestConvert"/>
    </Window.Resources>
    <Grid x:Name="RootLayout" >
        <TextBlock Text="Hello" Visibility="{Binding IsMargol, Converter={StaticResource TestConvert}}" FontSize="48" FontWeight="Bold" />
    </Grid>
</Window>

Thanks Ariel


Solution

  • Well, while the cause of the problem is still unknown to me.

    The solution to the mess was as followed:

    1. I've created a new Code Library project, and moved there all my controls and converters.

    2. I used the XmlnsDefinition attribute to decorate the assembly so each was corresponding to the same namespace.

    3. fixing all the references.

    and Voilà.

    Ariel