I read a couple of posts on how to create a custom dailog and the documentation also describes the steps to create a cistom dialog.Here is what i have so far, i wrote my custom dialog factory which inherits from ScheduleDialogFactoryBase and I wrote a custom view that displays properties for my appointment object. (the list data connector is bound to my custom object and i did the mapping )
When i change properties in my dailog for my entity, like start date time, i need it to update the infragistics appointment object too.Is there a clean way of doing this?
I am using MVVM model and i cannot access infragistics entities there and I have a wrapped control that wraps the ScheduleView.
It would be og great help if you could provide me with a sample that syncs the custom object in the custom dialog with the infragisitcs appointment object.
Please Suggest.
Thank You,
Hariharan
Also How do i close my custom appointments dialog ?
If you're using our ActivityDialogCore then this will be handled by the commands associated with that dialog - ActivityDialogCoreSaveAndClose, ActivityDialogCoreCloseCommand, etc. If you are providing a completely new element then I don't think there is anything currently. You could create a Wpf Window to host your element and return that and the datamanager will just show your form (modelessly or modally depending on the dialog type being displayed) and you can handle closing the window.
Ok so if i am using the Activity or Appointment Dialog Core, How do i wire my custom logic to the save command ?
I tried using the Activity Changed that gets fired when i save the appointment, but i need to be able to do some validation on save and stop save and close from happening if my validation fails. I tried handling this on Activity Changing , but I am not able to stop the dialog from closing if my validation fails.
Please find attached a sample project , when i make a change and click on save, I need to be able to do my validation and cancel Save and Close operation if validation fails.
hariharan019 said:Also, from the sampe that you sent , can I add more buttons to them and wire them to commands in the style? Or am i to write a user control that has a view model and embed that view in the style ?
If you're not using that ScheduleDialogFactory (which would be the case if you're not setting the DialogFactory property) then by default we create an instance of the appropriate ActivityDialogCore class (e.g. AppointmentDialogCore) and also an ActivityDialogRibbonLite that provides the ui for ribbon like navigation at the top. The NavigationControlSiteContent property of the ActivityDialogCore is set to that instance. So you may be able to retemplate that element adding what you need. You may even be able to use your own command for the Save and Close button instead of our command.
hariharan019 said: Also, from the sample that you sent, If I add the style to my control's resources (local resource) it does not work, but if I add it to the resource dictionary it picks the style from there. Is there a reason why it works this way, cause conventionally, DP looks up local resources first and then looks up the hierarchy.
Currently there are no public events or virtual methods that you could use to intercept the closing and perform extra validation for the ActivityDialogCore. You may want to submit a feature request with details about your requirements. If you need to do this now then you will likely have to create your own derived WPF Window and contain either an AppointmentDialogCore or your own UI for editing/creating the appointment. You would also need to provide the UI for toolbar/ribbon/menus that you want since that is up to the factory to provide.
Also, from the sampe that you sent , can I add more buttons to them and wire them to commands in the style? Or am i to write a user control that has a view model and embed that view in the style ? I am using MVVM Pattern.
Also, from the sample that you sent, If I add the style to my control's resources (local resource) it does not work, but if I add it to the resource dictionary it picks the style from there. Is there a reason why it works this way, cause conventionally, DP looks up local resources first and then looks up the hierarchy.