Geysser
Member
- Joined
- Apr 6, 2010
- Messages
- 17
- Programming Experience
- 5-10
Having had my fare-share of user control programming in VB.NET, I thought that jumping to the WPF UserControl arena would be a pretty straightforward process. Alas, things are much more different than expected - and way more difficult!
So here is what I stumbled upon:
From what I've came about through some research, I though that defining a Namespace would be all I had to do. So I add a folder named MyControls (I try to keep things clear and grouped) and I add inside a UserControl. Then...
Build...
Then I rush to my Main Window and I do...
OK.No errors!
I go and try to add an instance through...
...and...oops!...Intellisence doesn't produce MyControl!!! So it's not there!Plus, I take a look at my toolbox and I see...two user controls! One MyControl(MyProject) and one
MyControl(MyProject.MyControls).
Obviously, it's all mixed up in my head. What I'm asking from you is some clarification, some advice on how to approach UserControl creation.Any good Samaritan out there?
And thanks in advance!
So here is what I stumbled upon:
From what I've came about through some research, I though that defining a Namespace would be all I had to do. So I add a folder named MyControls (I try to keep things clear and grouped) and I add inside a UserControl. Then...
VB.NET:
Namespace MyProject.MyControls
Public Class MyControl
.
.
'Code Here!
'
'
End Class
End Namespace
Build...
Then I rush to my Main Window and I do...
HTML:
xmlns:mycontrols="clr-namespace:MyProject.MyControls"
OK.No errors!
I go and try to add an instance through...
HTML:
<mycontrols:.../>
...and...oops!...Intellisence doesn't produce MyControl!!! So it's not there!Plus, I take a look at my toolbox and I see...two user controls! One MyControl(MyProject) and one
MyControl(MyProject.MyControls).
Obviously, it's all mixed up in my head. What I'm asking from you is some clarification, some advice on how to approach UserControl creation.Any good Samaritan out there?
And thanks in advance!