Hi,
Continuation to http://www.infragistics.com/community/forums/p/95708/474087.aspx#474087
I want to create a new appointment on a button click. Is it possible in this Application?
I tried instantiating AppointmentDialogCore but don't know how to bring up that UI and assign a string ID value (automatically from Infragistics).
Thanks and Regards,
Nag
Hello Nag,
Thank you for your post. It sounds like what you are trying to do is add an appointment to a XamSchedule and then open that appointment's dialog core. Please correct me if my impressions here are incorrect.
To do this, I would recommend that you retrieve the DataManager from the schedule you are using, and then retrieve the DataConnector that the data manager is using. From the connector, you can retrieve the AppointmentItemsSource and add a new appointment to that. After adding the appointment, I would recommend calling DataManager.DisplayActivityDialog(myNewAppointment, frameworkElement fe) to open that appointment's dialog window. I have attached a sample project to demonstrate this. For the framework element in the method, I used "this" to have it opened by the main window.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi Andrew,
Not exactly like this. But I want similar functionality like in outlook double click.
In outlook, we have a new appointment button. If you click that, it will open Appointment Dialog.
I need similar functionality using Xam Outlook Calendar control. I want to have a button on my form as you have given.
But this shall not add appointment to the dataconnector. It shall add only when I save that. Otherwise, it shall discard those changes.
Your example adds to the appointments, display and if user dont want also still exists in calendar.
Thanks a ton for the update.
I tried using that sample but I have to replace Appointment with AppointmentDialogCore as I am using that.
If I replace that with AppointmentDialogCore, I can't get DisplayActivityDialog() working as it takes only Appointment.
If I use only Appointment (I have assigned my class object to DataItem also), I can't get "saveAndClose" button reference in the loading event as the loading event will be returning a reference to AppointmentDialogCore. This does not inherit ActivityBase so it does not return any reference for the button.
If I try to override CreateActivityDialog with AppointmentDialogCore also no use.
Please can you suggest me how to go on this?
Regards,
The Appointment and the AppointmentDialogCore need to work hand in hand, as the AppointmentDialogCore's data context is the appointment that spawned it. I'm not sure you will be able to use the AppointmentDialogCore without a corresponding Appointment object in this case. Please note that if you create an Appointment object, you do not need to add it to the XamSchedule before popping up the dialog. It only needs to have an OwningResourceId, OwningCalendarId, and Id property set on it. Everything else can be set and by utilizing the Loaded event on the AppointmentDialogCore, you can save the Appointment at a later time, if need be.
Is there any reason you cannot use both the Appointment and AppointmentDialogCore in this case? I believe if you can't, then your best option may be to create a custom dialog window and use that instead.
Just checking in, did you have any other questions or concerns on this matter?
Thank you very much for your updates.
I am able to get the dialog open but when I try to save changes, the save btn click event is fired and I can step through that.
After that event, I am getting a crash. I shall post the results.
Thanks and Regards,Nag
I am glad you were able to get the save button click event firing, but it is unfortunate that you are getting a crash afterward. I will await your post of the results of this crash that you are seeing.
Thanks a ton for your support. It is really great.
I am able to resolve my problem for showing existing and new appointments. The problem I faced is, even though I assigned OwningResourceId and OwningCalendarId, it is still expecting OwningrResource and OwningCalendar objects. After creating those, I was able to add new appointment and show existing ones.
But I am facing below problems now:
1. Reminder popup does not show for upcoming appointments. It only shows for expired/past appointments. Please can you shed some light into it?
2. If I keep the enter AppointmentDialogCore into a tabitem and add another 2 tabitems, the other tabitems button click events are causing a crash. I am not even able to load the appointment. Any idea on this?
Thanks again.
I am glad you were able to resolve the issue you were seeing with showing existing and new appointments.
Regarding the reminder popup, there may be a few things that you will want to check here. First, are you setting the XamScheduleDataManager's CurrentUserId property to the OwningResourceId of your Appointments? Also, are you setting the ReminderInterval property on your Appointments? The ReminderInterval determines how far before the appointment's occurrence time to show the reminder dialog. If it is not set, you will not see the appointment reminder until the appointment is about to happen. Here is a link to our online documentation for more information about XamSchedule reminders: http://help.infragistics.com/doc/WPF/2015.1/CLR4.0/?page=xamSchedule_Using_Activities_Reminders.html.
Regarding the AppointmentDialogCore inside of a tab item causing an exception, I cannot seem to reproduce this behavior you are seeing. I am a little unsure as to how you are placing the AppointmentDialogCore into a tab item, or whether the XamSchedule itself is in the TabControl that houses the tab items as well. Could you please provide some more detail on the functionality you are implementing here?
I have attached the sample project that I used to test this. If the TabControl mentioned in your step 2 does not depict what you are trying to achieve, would it be possible for you to modify it and send it back so that I can see the behavior you are seeing?
<My account is disabled and our product ID is not getting registered>
It seems the Reminder is also connected to TimeZone stuff where it is failing for New Zealand Standard Timezone.
I took all screenshots and updated the sample application, but to hell with, internet is not working and I can't upload right now. I shall do it once I get to it.
Main observations and modifications:
1. I removed .ToUniversalTime() for Start and End times.
2. Created an id with TimeZoneInfo.Id (which comes as "New Zealand Standard Time" string)
3. I assigned above ID to DataConnector.TimeZoneResolver.Id
4. If I start the application, it shows only past reminders. Also, it shows yesterday's time in the reminder page.
I shall definitely upload them tomorrow. Sorry for that.
Also, I ran into below problems.
1. When user creates appointment, I am adding it to DB and retrieving the details and assigning AppointmentItemSource.
2. But I was unable to do it for Categories. I can't find any events firing for that except overriding "DisplayActivityCategoryDialog". Please can you tell me how to get an event when a category is added?
3. The sample you have sent adds AppointmentDialogCore as a class but I am overriding AppointmentDialogCore as resource file and add tabs in that.
That is causing the problem. I will upload the example once I get my internet working.
Raj
Please find the attached sample where I am facing the problem for Reminder.
Hello Raj,
Regarding capturing the addition of a category in the XamSchedule, I would recommend hooking into the CollectionChanged event on the ActivityCategoryCollection that you have set as the data connector's ActivityCategoryItemsSource. This collection will hold your categories, and when you create a new category either through the UI or programmatically, this event will fire.
Regarding the AppointmentDialogCore, would it be possible for you to provide some more detail on the overrides that you are implementing? It sounds like you are adding a tab control inside of the dialog itself rather than adding the dialog to a tab control like in my original sample project, but I am not entirely sure. Would it be possible for you to please provide a sample application that demonstrates the error you are seeing with your dialog core, or modify the current one that is posted to this forum thread?
Regarding the reminders, I cannot seem to reproduce this issue you are seeing with the sample you provided. Out of curiosity, what happens when you click on the "Show Reminder Dialog" button after closing the initial reminder dialog that shows at the start? On my machine, I get a list of all of the reminders (future and past) that are active in the XamSchedule. I have attached a screenshot of what I am seeing on load of the control.