Skip to main content
Home Forums Silverlight Design Designing with Silverlight Error Please Help! Error 1 undeclared prefix [Line: 6 Position: 76]
6 replies. Latest Post by matt.raffel on July 28, 2009.
(0)
matt.raffel
Member
1 points
13 Posts
07-04-2009 7:35 AM |
I am getting this error: Error 1 undeclared prefix [Line: 6 Position: 76]
And it is keeping me from being able to use the designer. I do not understand why and really could some help understanding what is the problem. This is the xaml below. It's pretty simple.
<UserControl x:Class="Greed.Application.DefaultWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="1024" Height="768" > <Border x:Name="LayoutRoot" BorderBrush="Silver" BorderThickness="5" CornerRadius="5" > </Border></UserControl>
Thnx
Matt
jay nana...
Contributor
3388 points
624 Posts
07-04-2009 8:01 AM |
Can you describe your project structure? There should be problem with Greed.Application.DefaultWindow name space.
07-04-2009 10:41 AM |
What information is needed to help describe the project structure?
07-04-2009 11:40 AM |
So in looking around project structure, I looked at my "app" code:
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:Greed.Data.Converters;assembly=Greed.Data" x:Class="Greed.Application.App" > <Application.Resources> <converters:BoolToVisibleConverter x:Key="BoolToVisibleConverter" /> </Application.Resources></Application>
I found my problem. I do not understand why but the problem has to the with the BoolToVisibleConverter. Removing the resource allowed the designer to show for my UserControl (code first post).
This is the converter code:
namespace Greed.Data.Converters{ public class BoolToVisibleConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { bool objectValue = System.Convert.ToBoolean(value); if (true == objectValue) return Visibility.Visible; return Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { Visibility visibility = (Visibility)value; if (Visibility.Visible == visibility) return true; return false; } }}
I know that converters in silverlight are not the same as in wpf. But I thought this was an ok converter. Any ideas why this might be a problem?
Amanda W...
All-Star
17241 points
1,466 Posts
07-08-2009 2:33 AM |
Hi Matt,
You can try to refer below bold code to refer your converter.
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:Greed.Data.Converters" x:Class="Greed.Application.App" > <Application.Resources> <converters:BoolToVisibleConverter x:Key="BoolToVisibleConverter" /> </Application.Resources></Application>
07-08-2009 8:17 AM |
I didn't state in my previous post that the converter class was in a separate assembly. Looking at your changes, I'm guessing you assumed it was in the same assembly as the application...correct?
07-28-2009 3:49 PM |
It's been awhile since I had to deal with this issue, however I believe the problem is you cannot declare converters in the app xaml.