TabControl, ActiveView and ApplicationModel

Topics: Prism v2 - WPF 3.5
Mar 27, 2009 at 8:10 AM
Hi!

I am trying to build an application with an ApplicationModel. The model takes care of my diferent ModuleApplications which can be loaded into a TabControl, when the user clicks a button in the toolbar. The ModuleApplications implement the IActiveAware interface.
Adding views to the TabControl works but the latest added view is never set as SelectedItem automatically.
I don't know what I am doing wrong. Here is how I activate a ModuleApplication:

BuchungModuleApplication

 

app = null;

 

 

int kontoID = int.Parse(id.ToString());
List<IViewsCollection> list = new List<IViewsCollection>();
list.Add(
this.MainModuleApplications);
foreach (ActiveAwareModuleApplicationController con in list[0])
{
    
if (con.Name.Equals("Buchungen"))
    {
        app = (
BuchungModuleApplication)con;
        
this.mainModuleApplication.Activate(app);
        app.buchungViewModel.LoadModel(kontoID);
        
break;
    }
}

The view gets activated but not set as SelectedItem.  I thought I would have to deactivate the other views and made an else wher I said app.IsActive = false;
My implementation took this great article as base:
http://blogs.msdn.com/erwinvandervalk/archive/2009/03/02/how-to-build-an-outlook-style-application.aspx

Has anybody an idea what could be wrong?
Thanks in advance!

Mar 27, 2009 at 2:54 PM
Check if this is causing the issue for you.

Note: The release was refreshed on 2/25/2009 to correct an issue with TabControl regions and an issue with an upcoming Silverlight release. You can download the latest release from the 'final version' link above. You can verify if you have the latest version of the self-extracting archive by examining the Digital Signature timestamp it should read 'Tuesday, February 24, 2009 12:00:07 PM'.
Mar 30, 2009 at 6:36 AM
Hi Kaja,

I checked the timestamp and indeed we had the older version. I replaced it with the new one, but the problem remains. The newly added view is not set as selected item.