tags:

views:

28

answers:

1

Hi, The following code is in a MEF MVVM desktop application. The Shell is already build, but a Module is initialising. The Module wants to add text to a ContentControl in the Shell, but the following code does not cause the change to be seen in the Shell Window. Any suggestions as to how I get the window to update.

thanks

    [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;

John

A: 

Hi, It was geting late and I didn't notice I was creating a new view instead of finding the current one. Sorry all. John

jradxl