-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Allow Overriding FindOwnerWindow #221
Allow Overriding FindOwnerWindow #221
Conversation
Hi @RFBomb! Thanks for the contribution, I'll make a new release. |
A new NuGet package has now been published. |
Awesome, thanks for the quick turnaround! |
Hey, Since .NetFramework 462 is still listed as a target here, can |
This codebase has removed support for .NET 5 due to its deprecation as of May 10, 2022, and .NET Core 3.1 was removed in preparation for its deprecation December 13, 2022. I'm hoping you'll be able to migrate. |
Unfortunately I will be unable to migrate, as the company I develop for will not be upgrading to VisualStudio 2022 any time in the forseeable future. As such, I'll just have to have it forked until that time. |
Description
Rename the static
FindOwnerWindow
method toFindOwner
and introduce a protected virtualFindOwnerWindow
method.Currently, most of the service action can be modified by introducing different factories for the type locators or dialog factories. The exception to this rule is locating the owner window. This change fixes that.
In my application, I have many custom controls that are a combination of other controls. (For example, a control that houses around 10 comboboxes, about 6 buttons, a listbox, etc). This is controlled by what I deemed a 'ControlModel'. The 'ControlModel' has a property called 'Parent' which points to its parent ViewModel.
The tricky thing here is that the 'Parent' may not be on the registered view, the Parent's Parent may be though. So what I want to do is traverse up the 'Parent-Tree' until I find the registered view. Currently, this library does not allow for that.
So this PR exposes the method of finding the parent window and allows overriding just that functionality if needed. I figured this would be fine since the DialogService class is not sealed.
My usage would look something like this:
Checklist