How can "Click To Add Appointment" be disabled in WPF?
There's no property currently exposed to disable it but the element is a ClickToAddActivityElement so you could change its template to not have anything visible or set its Opacity/IsHitTestVisible so it won't be visible or interactive. E.g.
<Style TargetType="igPrim:ClickToAddActivityElement"> <Setter Property="Opacity" Value="0" /> <Setter Property="IsHitTestVisible" Value="False" /></Style>
Where am I supposed to place this code?
You could put that in the Resources of the xamSchedule control, one of its ancestors or even in the Application's Resources.
I use that code so it has error : Type 'igPrim:ClickToAddActivityElement' was not found.
And I not see any type 'igPrim:ClickToAddActivityElement' in file "generic.shared.xaml".
Have I got some wrong?
it is OK, thanks for help.
The ClickToAddActivityElement has nothing to do with the dialog; that simply relates to the "Click to Add Appointment" prompt that is displayed within a timeslot when you hover over it. If you don't want users to add using the activity dialog (i.e. what you see when you double click on a timeslot) then you can handle the ActivityDialogDisplaying event and set e.Cancel to true as needed (e.g. if the DataItem is null). If you are using 11.1 then you can set the IsAddViaDoubleClickEnabled on the ScheduleSettings->AppointmentSettings to false.
I implement to add some Appoiments by hide code. For dont want users add Appoiments by
Dialog I add:
So I see that, it still allow user add Appoiments by Dialog.
I'm sorry but I don't understand the issue you are having. Can you provide a sample that demonstrates the issue and steps when running the sample? Or perhaps provide a more detailed description with screenshots?
I see that : When I add Appointments by hide code then Click to Add Appointment not be disabled.
What I do to disabled this dialog in this case.
Thanks for help.