✅ Problems adding usercontrol
I'm trying to add a usercontrol to a window.
In the window I added the local reference liek this:
`
And i have use it like this:
My usercontrol is inside a folder called controls inside the project.
Does anyone know why it's not working?
35 Replies
The userControl is defined like this:
`
`
To help you to get any answers:
What is the actual error you are getting?
Error XDG0008 El nombre "DataGridAlarmes" no existe en el espacio de nombres "clr-namespace:PrototipServer.Controls".
The name"DataGridAlarmes" dosn't exists in the namespace ...
It says that the type does not exist in that namespace
Yeah
As you can see it's there
Are you using the control in the same project?
yes
Or in a different one?
Okay
i'm trying to use it in a window called Manteniment
and then i'm using it like this:
`
Does not look wrong to me
Did you try rebuilding the project?
Yes. and also clean it
and it gives me the same error all the time
Hm, no clue then
You could try to come up with a minimal example
Create a new project + window + user control
And replicate it
If it works -> You are missing something
If it does not work -> We have to take a closer look
Okey ty, i will try it now
One more thing
Did you also check the cs file of that user control?
Make sure the namespace is correct there too
Click the little arrow next to the xaml file
Everything has to match to make this work
Yes i have check it. Also i created a new project with a blank usercontrol inside a folder called controls and then add it to the main window and im getting the same error.
So i guess i'm doing something wrong when adding the usercontrol
Let me try it quickly
okey
Works for me ;D
Can you share the contents of the files?
😦
$codegif
yes should i pass you the new project or the one i was working on?
The new one which is also not working
Not as a download or zip tho
Just paste it
yes yes i know
Now i rebuild the solution and it works
but not in the other one
Something is wrong in the other one then
yes
i will check it now. Ty for the help
You are welcome!
You can try adding a new namespace
Just for testing
With a dummy user control
i will create the usercontrol again
Wow. Crazy how idiot I am.
I was rebuilding without removing the errors...
hehe
$close
If you have no further questions, please use /close to mark the forum thread as answered