Shell已经生成,但是一个模块正在初始化。
模块希望向Shell中的ContentControl添加文本,但以下代码不会导致在Shell窗口中看到更改。
关于如何更新窗口的任何建议。
谢谢
[ImportingConstructor]
public ModuleInit(IView1Model vm)
{
var viewModel = vm as ViewModels.View1Model;
var view1 = GetView(viewModel);
var shellModel = viewModel.Shell;
var shellView = GetView(shellModel);
Control c1 = shellview as Control; //Window
ContentControl c2 = c1.FindName("ActiveItem1") as ContentControl;
TextBlock tb = new TextBlock();
tb.Text = "New Text Message";
c2.Content = tb;
约翰