Approved
Last Updated: 10 Jan 2019 15:27 by ADMIN
Stefan
Created on: 10 Jan 2019 08:07
Category: ScheduleView
Type: Feature Request
2
ScheduleView: Conditionally Hide Appointment Delete Button

hi,

 

I can I make a feature request please for the appointment item control. I'd like to be able to have the delete button hidden depending on whether my appointment wants to hide the delete button. Some appointments can be deleted, some can't. the problem with the current option of using the schedule control is that it's all appointments can be deleted or all appointments can't.

because of all the different themes and complexity around them I don't want to change the actual underlying template, so to resolve this myself I have made a source code change in AppointmentItem.OnApplyTemplate. I have added this code in to create a binding:


            // Stefan: start
            // Ensure that the can be Show and hidden depending on the appointment type
            var deleteButton = GetTemplateChild("DeleteButton") as Button;
            if (deleteButton != null)
            {
                BindingOperations.SetBinding(deleteButton, Button.VisibilityProperty, new Binding()
                {
                    Path = new PropertyPath("Appointment.ShowDeleteButton"),
                    Converter = new System.Windows.Controls.BooleanToVisibilityConverter()
                });
            }
            // Stefan: end

hopefully this can be built into the system using a multi-binding where you check for the schedule control allowing deletion and then on a per appointment basis.

Thanks,

Stefan

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments