Replies: 1 comment 1 reply
-
It's not clear why you need an Sure, if you want to have a static class which can show dialogs, just: public static class ShowDialogFactory
{
public static IWindowManager WindowManager { get; set; }
public static bool? ShowDialog(object viewModel) => WindowManager.ShowDialog(viewModel);
} Then in your bootstrapper's ShowDialogFactory.WindowManager = Container.Get<IWindowManager>(); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have lot of dialogs in application in different places, and at all that places I call IContainer and IWindowManager. I'd like to avoid calling IContainer and IWindowManager in hundreds of places just to show dialog, so I was trying to figure out what you were written in documentation, but I couldn't quite understand how to implement factory that will create dialog for different view models.
My idea is to have e.g. some static method that I could call to show me any dialog I want, and to return me a result, something like this
bool? result = ShowDialogFactory.ShowDialog(ViewModel1);
bool? result = ShowDialogFactory.ShowDialog(ViewModel2);
or similar to that.Could you please give some hint? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions