Hi,
I am currently evaluating the Schedule control and noticed a problem when creating custom dialogs for it. The DialogFactory is working fine, but insufficient. My problem is that there seems to be a "DialogManager" working in the background, which is doing a bit more with the Window-object I provide than I would like to (as seen in Reflector).
- It shows the dialog non-modal (I would like a modal dialog)
- It sets the Window's owner to itself instead to the actual parent window (I want to specify the Window owner myself)
- It resizes the Window (I use a Settings class to save and restore last used window sizes, so I don't want the DialogManager to interfere)
- Plus some other actions like a focus change or a window title change that I'd rather not have.
Can you please tell me how to avoid the "magic" invoked by the DialogManager?
Best regards,
Florian
Hi Florian -
Thx for the update. Good points - I will pass along your comments to the docs team.
As for replacing the DialogManager, that is essentially what you are doing by cancelling the event and displaying the window yourself.
Joe
Thanks, the ActivityDialogDisplaying event works fine for me, though it somewhat defeats the purpose of the dialog factory if this event is more "powerful" than the actual dialog factory class. Maybe it would be best if you could provide your own DialogManager? I'm happy with the way it works, but it took me a while to figure out who messes with my window. Maybe that should at least be documented somewhere near the custom dialogs section.
The DialogManager class is designed to abstract away the differences involved in displaying dialogs in WPF and SL. It does go a bit further however when it gets involved in window sizing, modality and focus to suit the needs of the Schedule controls. To get around this we could potentially raise a new event in the XamScheduleDataManager to give you the opportunity to affect sizing, modality and focus and even the Window owner before the dialog is displayed. Please submit a Feature Request for this.
As an alternative you should be able to listen for the XamScheduleDataManager's ActivityDialogDisplaying event and cancel it so you can create/display your own dialog in a way that works best for your app.