Add a user control to a wpf window

后端 未结 4 1799
悲&欢浪女
悲&欢浪女 2020-12-02 19:38

I have a user control that I\'ve created, however when I go to add it to the XAML in the window, Intellisense doesn\'t pick it up, and I can\'t figure out how to add it to t

4条回答
  •  爱一瞬间的悲伤
    2020-12-02 20:26

    You need to add a reference inside the window tag. Something like:

    xmlns:controls="clr-namespace:YourCustomNamespace.Controls;assembly=YourAssemblyName"
    

    (When you add xmlns:controls=" intellisense should kick in to make this bit easier)

    Then you can add the control with:

    
    

提交回复
热议问题