Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attached RegionManager to dialog by default #1807

Merged
merged 1 commit into from
May 24, 2019

Conversation

brianlagunas
Copy link
Member

Description of Change

If you create and show a new Window in Prism and then try to navigate within regions, it will fail because there is no RegionManager associated with the new Window object.

The IDialogService has been modified to automatcally assign the application's RegionManager to eacvh dialog window instance so that region navigation will work out of the box

Bugs Fixed

API Changes

None

Behavioral Changes

Region navigation will now function properly when navigating within the IDialogService

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

@brianlagunas brianlagunas merged commit 381d56c into master May 24, 2019
@brianlagunas brianlagunas deleted the IDialogService-Updates branch May 24, 2019 16:34
@@ -29,6 +32,7 @@ public void ShowDialog(string name, IDialogParameters parameters, Action<IDialog
void ShowDialogInternal(string name, IDialogParameters parameters, Action<IDialogResult> callback, bool isModal)
{
IDialogWindow dialogWindow = CreateDialogWindow();
RegionManager.SetRegionManager((DependencyObject)dialogWindow, _regionManager);
Copy link
Contributor

@noufionline noufionline May 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RegionManager will work only the first time. subsequent clicks will throw ArgumentException: Region with the given name is already registered:

Can you find a way to fix this issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you will need to implement scoped regions to do this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually thinking I should remove this now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the same reason the base vm was removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly!

@lock
Copy link

lock bot commented Jan 28, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants