Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF class not found in XAML

Tags:

c#

wpf

xaml

I'm trying to create a key for a class to use in XAML, but Visual Studio 11 says that no such class exists.

Steps:

I created a class inside my program namespace:

namespace Test {
    public class PointCollectionConverter : System.Windows.Data.IValueConverter....

I added a local namespace reference in MainWindow.xaml

xmlns:local="clr-namespace:GeometryTest"

I try to add the class as a resource:

<Window.Resources>
      <local:PointCollectionConverter x:Key="pointCollectionConverter"/>
</Window.Resources>

Fixed after recompilation.

like image 831
stan Avatar asked Dec 04 '25 02:12

stan


1 Answers

The namespace is Test and you use GeometryTest? Something's not right here.

How about:

xmlns:local="clr-namespace:Test"
like image 192
H.B. Avatar answered Dec 06 '25 14:12

H.B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!