How to pass Parameters from xaml window to WPF usercontrol constructor? I have tried creating dependency property, but it fails to do it. Should I try xaml extensions or is the
XAML can't use constructor with parameter. Keep what you've tried with dependency property :
then you can try this in constructor :
public Myusercontrol() { InitializeComponent(); Loaded += (sender, args) => { UserControlViewModel vm = new UserControlViewModel(Param1); this.DataContext = vm; }; }