question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No regions at module initializing

See original GitHub issue

In the overriden method on IModule OnInitialized the RegionManager has no regions.

public void OnInitialized(IContainerProvider containerProvider)
{
    var regionManager = containerProvider.Resolve<IRegionManager>();
    regionManager.Regions["ContentRegion"].Add(new ViewA());
 }

When the shell ist created and updates the regions, the visual parent is always null.

https://github.com/AvaloniaCommunity/Prism.Avalonia/blob/ff4e77276a10beb2915bd52fd09cc4ce79378a4a/src/Prism.Avalonia/Regions/Behaviors/RegionManagerRegistrationBehavior.cs#L142

When I debug Prism.Wpf, the RegionManager has regions at modul intializing.

I can provide an example, if needed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

2reactions
jamsoftcommented, May 26, 2022

OK, this has properly thrown me off. Glad I found this chat.

Can we add a note to the main page as things like this mean the main ReadMe isn’t actually correct as the development isn’t the same as WPF if things like this don’t work as per WPF Prism

2reactions
EinApfelBaumcommented, May 9, 2020

Yea, I ported some of the official Prism WPF Samples to Prism.Avalonia. Good practice for Prism and avalonia understanding. =)

With this behavoir some examples / usecases will not work. The example UsingCompositeCommands in the solution https://github.com/EinApfelBaum/Prism.Avalonia.Samples/tree/master/src/11-Commands is one of the use case. In the Module OnInitialized I want to add some Tab Views.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prism Module doesn't get initialized
This seems like a bug in the module loader, especially since no error/log appears to be generated and it just silently fails. Haven't...
Read more >
Create an initialization module
Describes how to create an initialization module to work with the initialization system ... You do not need to lock regions when you...
Read more >
Can't initialize SX1268 lora module - Support
Looks like you have set “region 0” or no region at all. region 0 seems to have weird settings because the output says...
Read more >
Creating an initialization module (CMS 9)
This topic describes how to create an initialization module to work ... You do not need to lock regions when you deal with...
Read more >
Enhancing the Prism Module Initialization Lifecycle
Prism facilitates simple module initialization upon application startup, but this is not always adequate for every application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found