You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if I wasn't required to use the IWpfShell marker interface to have the startup window. This requirement means that specific Window is special, and it is so at compile time. Using attributes has similar problems.
As an alternative, consider if there was an IStartupWindowFactory interface, whose duty was to provide a list of startup Window. It could provide different Window based on whatever factors the developer chooses.
The default implementation of IStartupWindowFactory could use the current IWpfShell marker interface, making it a drop-in replacement.
You can see that the IWpfShell interface has been removed from the window. (Source)
A default implementation of IStartupWindowFactory is included that uses IWpfShell. Since it's using TryAddSingleton, it will be added if and only if the user has not already added their own implementation. (Source)
This shows the default implementation of IStartupWindowFactory. With this implementation there is no change in behavior from current. (Source)
This shows how the user would create a custom IStartupWindowFactory (Source)
This shows how the user would add that custom IStartupWindowFactory. Since it's using AddSingleton, it's going to override the default factory that was added with TryAddSingleton. (Source)
The text was updated successfully, but these errors were encountered:
It would be nice if I wasn't required to use the
IWpfShell
marker interface to have the startup window. This requirement means that specificWindow
is special, and it is so at compile time. Using attributes has similar problems.As an alternative, consider if there was an
IStartupWindowFactory
interface, whose duty was to provide a list of startupWindow
. It could provide differentWindow
based on whatever factors the developer chooses.The default implementation of
IStartupWindowFactory
could use the currentIWpfShell
marker interface, making it a drop-in replacement.See this repository / diff showing one way it could be done.
IWpfShell
interface has been removed from the window. (Source)IStartupWindowFactory
is included that usesIWpfShell
. Since it's usingTryAddSingleton
, it will be added if and only if the user has not already added their own implementation. (Source)IStartupWindowFactory
. With this implementation there is no change in behavior from current. (Source)IStartupWindowFactory
(Source)IStartupWindowFactory
. Since it's usingAddSingleton
, it's going to override the default factory that was added withTryAddSingleton
. (Source)The text was updated successfully, but these errors were encountered: