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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:05:44+00:00 2026-05-20T10:05:44+00:00

I have a WPF application with a simple tabular region layout as follows: —————————–

  • 0

I have a WPF application with a simple tabular region layout as follows:

-----------------------------
|   Region 1  |   Region 2  |
-----------------------------
|   Region 3  |   Region 4  |
-----------------------------

I want to offer the ability to register modules and their position based on module/app configuration e.g. Register “Module1” in Region 1 and set its rowspan to 2 so that it overlaps region3 or perhaps register Module1, Module2, Module3 and Module4 in there respective regions, or alternatively register Module1 so that it consumes the entire grid.

My current thinking is to define the four regions in the Shell, load the modules from a XAML module catalog and set the row/column/rowspan/columnspan from the app.config however it would be ideal if there was some way in which I could extend the module catalog so that each module entry could directly specify the grid settings directly (much like attached dependency properties), I could then read these during module initalisation and register the modules in each region as required.

Hope this makes sense if not let me know and I’ll try to clarify – I may well be overcomplicating things!

  • 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-20T10:05:45+00:00Added an answer on May 20, 2026 at 10:05 am

    First of all, in the question you are confusing views with modules. A module can be initialized without adding any views at all to your UI, or it may add several. So, assuming that in your case a module will expose exactly one type of view, it would be better to describe the setup as “add View1 in Region1” etc.

    To solve your problem, you can use the Grid-based approach in your example like this:

    1. Declare your Grid in XAML with as many cells/regions as you want, just like your example. (Since your app will have a greatly dynamic layout, this could be better done manually in code. But if you ‘re willing to accept some hardwired row/column limits, XAML will work fine too and it will be simpler)
    2. Define a Prism event which your add-on modules will use to notify a “master” module that they have been initialized. The master module will load before any add-on module and take care of the layout. When raising this event, the add-on modules will include the types of views they have configured the container with as part of the event arguments.
    3. When initializing, the master module will subscribe to the “module initialized” event. Whenever the event is raised (an add-on module has been initialized), the master module will resolve a view of the appropriate type from the container (remember: the add-on module has told us what type of view to resolve).

    It is then very simple to achieve your goal like this:

    var view = container.Resolve(typeOfViewFromAddOnModule);
    var uiElement = (UIElement)view; // because that's what it's going to be
    Grid.SetColumn(uiElement, X);
    Grid.SetRow(uiElement, Y);
    Grid.SetColumnSpan(uiElement, Z);
    Grid.SetRowSpan(uiElement, W);
    var region = // get a reference to your Grid region here
    region.Add(view);
    

    You are free to determine the values of X, Y, Z, W in whatever way you wish (load them from configuration, auto-assign them if they are not present, have the add-on module specify them in the “module initialized” event, etc etc).

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

Sidebar

Related Questions

I have a simple WPF application which I am trying to start. I am
I have a simple WPF application with a menu. I need to add menu
I have a very simple WPF application in which I am using data binding
I have a simple message box in a WPF application that is launched as
I have written a WPF application that I want to port to Silverlight 2.
I have a simple WPF application with a webbrowser control. When I direct the
I have a simple WPF application that uses ClickOnce to handle installing. Within this
I have a simple WPF application I'm using for experimenting. I have two themes
I have encountered something very strange, simple WPF application <Window x:Class=ListBoxSelection.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow
I have a WPF database viewer application: It's a simple main window containing a

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.