Reputation:
I have been implementing this solution explained here to make an outlinedTextbox.
I have created a test project and added directly in the main namespace and it works.
Now I want to add it to a library (HelperLib) and want to use it in whatever program of mine I want. For example here the program is called pcdLoggerS2.
but when I add it to my xaml it says that
so it's a matter of namespaces. Therefore I have add this
xmlns:local="clr-HelperLib"
in my definition of my Base:WindowViewBase but nothing has changed but it's really in that namespace!
Upvotes: 1
Views: 1059
Reputation: 254
You need to make sure that you've added the HelperLib project as a reference to your test project.
Open PcdLogger and right click on References, and add that project as a reference. Until you do this, the XAML in your test project will not be able to find the correct assembly.
Additionally, when you reference a namespace, from another assembly, you need to add that information to the namespace declaration in your XAML.
(See: https://msdn.microsoft.com/en-us/library/bb514546%28v=vs.90%29.aspx)
As an example: (I would suggest leaving local for your local namespaces)
xmlns:helper="clr-namespace:HelperLib;assembly=HelperLib"
EDIT: Additionally, Visual Studio's intellisense is fond of telling you that the namespace, or class, does not exist until you have built the project. You may have to rebuild and/or close/reopen the xaml file for intellisense to cooperate again.
Upvotes: 0
Reputation: 337
check Namespace of you class.
HelperLib
its name of a class, but not namespace.
Upvotes: 0