WPF MVVM Binding dynamic control in code behind and pass in View
问题 I am working on WPF application using MVVM. I have two page. I have multiple UserControls in a page 1, on selection of UserControls from page 1, I want to show that selected userControl in 2nd page. Below are my code. ViewModel Code public RelayCommand<string> OnClickSelectWidgetCommand => new RelayCommand<string>((setUserControlName) => { using (new CursorWait()) { var MyContentControl = setUserControlName; MessageBox.Show(MyContentControl); //How to render UserControl to View? } }, true);