I have created 2 WPF control which reside in the same folder and i want to add one control to the other.
The controls are added in a Win Forms project.
the thing is that in a custom Win Forms control I can see my two WPF controls in the toolbox but in the WPF designer I cannot see any WPF controls. Any ideas why?
And how can I add my control is XAML without dragging from the toolbox
I tried with
<UserControl x:
xmlns:my2="my.name.space"
Height="300" Width="300">
<Grid>
<my2:MyControlName>
</my2:MyControlName>
</Grid>
But that doesn't work with the type "my2:MyControlName" doesn not exist
I'm not sure why the controls don't show up in the toolbox, as I generally don't use the designer, but in order to access your controls in XAML, the xmlns should be:
<UserControl xmlns:my2="clr-namespace:my.name.space;assembly=my.assembly"
If the controls are in the assembly that is creating the UserControl, you should drop the ";assembly=my.assembly" part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With