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 -
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.
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.
Hello floele,
This is just a follow up if you have any questions with the xamSchedule control and that I may be of any further assistance with this thread.
No questions currently, I'll let you know if anything else comes up.
Feel free to ask any further questions on using the xamSchedule control and if you require any further assistance with this thread.
Let me know if you have any questions with this matter. Thank you.
Hello Duane. I tried using your sample solution to create custom Appointment support, obviously instead of custom Journal entries, mine supports custom Appointment entries. Like in your sample, I created subclasses of ListScheduleDataConnector, ScheduleDialogFactoryBase, and AppointmentDialogCore. I also created my own Model classes for the custom appointment data and created my own dialog type in XAML. I can get the calendars to load my data from a database and see it in the calendar; I can add new appointments to the calendar that have my custom fields. And, I can save the data from the dialog back to the database. However, when I try to edit/open existing appointment entries, it will show the custom dialog populated with the correct data, but then I get a null reference exception stemming from the GetActivities() method on the class that inherits from ListScheduleDataConnector. I did not override the GetActivities() method, only the CreateNew() method, per your example. Do I need also to override the GetActivities() method? If so, do you have an example of this? Or, is there something else I might be missing?
Nevermind. I finally figured it out. I had unintentionally overridden a couple of properties from one of the base classes that was causing a binding problem at runtime in the edit case.
Please disregard my question.