UserMessagesInformation

UserMessagesInformation

Hi,   I follow MVVM pattern in my project. I have a usercontrol whose constructor takes an argument, as shown below.     public partial class UserMessagesInformation : UserControl { public UserMessagesInformation(IUnityContainer container) { InitializeComponent(); DataContext = container.Resolve<IUserMessagesViewModel>("UMVM"); } }I need to add this usercontrol in my main window.xaml. When I do so I get compilation error.<lcl:UserMessagesInformation HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>The error which I get is "The type userMessagesInformation does not include any accessible constructor".  Kindly let me know how to fix it. Thanks,sanjay.   解决方案 这篇关于在主窗口中添加没有默认构造函数的用户控件将引发异常.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-27 13:47