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 4033964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:54:46+00:00 2026-05-20T11:54:46+00:00

I am creating a Prism 4 demo app to learn the new framework, focusing

  • 0

I am creating a Prism 4 demo app to learn the new framework, focusing on view-switching. The app has several regions, one of which is an ItemsControl that holds one or more buttons from the currently-active module.

I am registering the buttons with the Region Manager in each module’s Initilize() method. Here is the registration code for the first module:

RegionManager.RegisterViewWithRegion("ButtonRegion", typeof(ModuleAButton1));
RegionManager.RegisterViewWithRegion("ButtonRegion", typeof(ModuleAButton2));

The second module registers its buttons the same way. I use RequestNavigate() to switch between the two modules.

Here’s my problem: The buttons from both modules are visible in the ItemsControl, instead of just the buttons from the active module. I considered changing the ItemsControl to a ContentControl and putting the buttons in a StackPanel, but for reasons I won’t bore you with here, that won’t work for me. What I need to do is either:

  • Load the buttons when a module is activated, and unload them when I switch to the other module, or

  • Show the buttons when a module is activated, and hide them when I switch to the other module.

How do I do that in Prism 4? Thanks for your help.

  • 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-20T11:54:47+00:00Added an answer on May 20, 2026 at 11:54 am

    I found my answer. Implement the IRegionMemberLifetime interface on the view or its view model. The interface is made up of a single read-only boolean property, KeepAlive. If the property is set to true, the view will be kept alive after the user navigates away from it. If the property is set to false, the view will be unloaded. See the “Developers Guide to Microsoft Prism” (Ver 4), p. 121.

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

Sidebar

Related Questions

I am creating an application using WPF which is using Prism framework. I have
I am creating a Prism 2.1 app in which I have implemented logging, using
I am creating a Composite WPF (Prism) app with several different projects (Shell, modules,
I am playing around creating a demo prism application. The application I have has
I am creating a simple Prism 2.1 demo that uses the 'directory search' approach
I'm creating a WPF app using Prism and Unity as the container. A couple
Creating an iOS app in Flash Builder 4.5 which is a small Hello World
Is anyone out there using the Prism framework with Ninject instead of Unity? I
I recently downloaded the MVVM toolkit on codeplex from WPF futures which basically has
Creating a CMS, I have a settings table, in which I store many CMS

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.