Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:09:51+00:00 2026-05-31T10:09:51+00:00

In my mainwindow i have a tab control, i need to notify different modules

  • 0

In my mainwindow i have a tab control, i need to notify different modules that different tabs has been activated or closed. The tabcontrols SelectedItem is bound to ActiveView in my viewmodel

<TabControl Padding="0"  SelectedItem="{Binding ActiveView}"
                    x:Name="MainViewTab" prism:RegionManager.RegionName="{x:Static inf:RegionNames.MainRegion}"
                    VerticalAlignment="Stretch"
                    ItemContainerStyle="{DynamicResource TabHeaderStyle}" 
                    AutomationProperties.AutomationId="MainViewDeatilTab"        
 />

In the region Mainregion i load different views

 UriQuery parameters = new UriQuery();
            parameters.Add("OBJECTID", item.ObjectId.ToString());
            regionManager.RequestNavigate(RegionNames.MainRegion,
                                            new Uri("AIT.Modules.SiteEditor.Views.SiteEditor" + parameters.ToString(), UriKind.Relative),
                                            NavigationCompleted);

The selecteditem is bound to property ActiveView and in the property i need to raise an event that contains OBJECTID as a paramenter.

My problem is that the tabcontrols SelectedItem fires before the view has a chance to load the OBJECTID parameter, which i load in Prism OnNavigatedTo . Anyone has an example on how you manage tabcontrols open and close events so other modules can be notified about current views?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:09:52+00:00Added an answer on May 31, 2026 at 10:09 am

    If you’re not detesting code-behind within your mainwindow, you may subscribe the public Navigated event of the region’s navigation service one can access via the NavigationService-property of IRegion. The corresponding event handler gets the NavigationContext of the navigation request and thus the URI.
    As an compromise you could just delegate the event handling from your mainwindow-code-behind to your viewmodel.
    This is at least one approach I once used.

    To avoid the code-behind, you could write a attached property for the RegionManager that does the connection between the event and your viewmodel for you.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a mvvm app that the main window is a tab control. i
I have MainWindow and 2 user controls. In Main Window there is Tab Control
My MainWindow.xib has a Tab Bar Controller in it with various tabs. Each tab
I have a UITabBarController in my MainWindow.xib. Each tab contains a UINavigationController which has
I have a view that is loaded in the MainWindow.xib. It is just a
I have 2 views (first view - custom user control, MainWindow view - main
The thing is that i have a 'log in window' and a 'mainwindow' that
I have idea to implement my wpf windows like TabPages in tab control. It
I have a UITabBarController as my MainWindow.xib . I have 3 tab bar items
I have the following in the mainwindow.xib Navigation Controller List item Tab bar controller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.