i have this converter class :
namespace WorkflowPhone8.Helpers_and_Extensions
{
public class InboxItemValueConverters : IValueConverter
{
public object Convert(object value, System.Type targetType,
object parameter, CultureInfo culture)
{
int urgency = (int)value;
Brush brush = new SolidColorBrush();
if (urgency == 0)
{
brush = new SolidColorBrush(Colors.Green);
}
else if (urgency == 1)
{
brush = new SolidColorBrush(Colors.Yellow);
}
else if (urgency == 2)
{
brush = new SolidColorBrush(Colors.Red);
}
return brush;
}
public object ConvertBack(object value, System.Type targetType,
object parameter, CultureInfo culture)
{
return null;
}
}
and in my xaml i referenced this class as follows :
<phone:PhoneApplicationPage.Resources>
<src:InboxItemValueConverters x:Key="converttocolor" />
as i build solution it says :
Error 1 ‘src’ is an undeclared prefix. Line 71, position 6.
anyone knows why it does this?
or should i reference this another way?
using visual studio 2012, windows phone 8, silverlight, c#
thanks in advance.
You need to declare
srcas a namespace in your XAML. It would be something like this.Though your
Window-class (orUserControlfor that matter if you are using this in a usercontrol) will have other namespaces as well so just append the correct namespace declaration to your root-element in your XAML.