Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Converter not found in xaml designer

$
0
0

I am not sure if this is the right forum to ask this question, but we are seeing  an error along the lines in the xaml designer:

The type BooleanToWidthConverter  was not found.  Check your ....

in the xaml designer regarding a converter and aren't sure why. The code compiles and runs just fine but we can not load the page in the designer nor see the converter in the intellisense.

We do see other converters from the same .cs file in the namespace and they work on the xaml page.

This is the xaml - nothing unusal:

<local:BooleanToWidthConverter x:Uid="anui:BooleanToWidthConverter_1" x:Key="BooleanToWidthConverter"/>

 Is there anything wrong with the following converter?  What else should I be checking?

[ValueConversion(typeof(bool), typeof(double))]
public class BooleanToWidthConverter : IValueConverter
    {
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(bool)value)
            {
                return 0;
            }
            else
            {
                return double.NaN;
            }
        }

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


Elizzabeth Zelasky


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>