Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
600
Custom appointment temlates
posted

We are looking at the xamSchedule control to implement in our application.

Is there an easy way to have several appointment templates (containing different info) depending on the appointment type.

  • internal appointment: subject, room, icon for presence of beamer, ...
  • external appointment: subject, full address

Does there exists a property like Appointment.ItemTemplate where I can bind a custom datatemplate to.

 

 

Parents
  • 34510
    Verified Answer
    Offline posted

    Hi sidhume,

    Which part of the appointment are you trying to template?  The presenter part which is shown on the actual day in the calendar?  Or the dialog portion which allows you to edit the appointment?  It sounds like you want to change the presenter part.

    By default we only provide one type of appointment so I'm not sure how you plan to distinguish some appointments as internal and external.  Maybe you will derive your own class from Appointment?  If you do that, it would be possible to use Style.Triggers in order to control what template to use.  You could create your two templates and then in a style for AppointmentPresenter you could add a DataTrigger who's binding is set to the AppointmentPresenter's DataContext.  The DataContext will be the appointment.  You should add a converter to the binding and inside the converter determine what the appointment type is.  If it is internal, you can add a Setter to the DataTrigger that will set the AppointmentPresenter.Template to your internal template.  You would need another trigger for the external template as well.  Something like this: 

    <Style TargetType="{x:Type igPrim:AppointmentPresenter}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Converter={StaticResource CheckAppointmentType}, ConverterParameter={x:Type local:MyInternalAppointment}}" Value="True">
                <Setter Property="Template" Value="{StaticResource MyInternalTemplate}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Converter={StaticResource CheckAppointmentType}, ConverterParameter={x:Type local:MyExternalAppointment}}" Value="True">
                <Setter Property="Template" Value="{StaticResource MyExternalTemplate}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

     

  • 34510
    Offline posted in reply to Geert Van Canneyt

    Hi Erik,

    When I think of planning tools, a gantt chart usually comes to mind.  You can read more about it here.  As for whether it is a better fit for your needs, it depends.  If all you need is simple scheduling then the xamSchedule would probably be a better fit as you can create the appointments and set the start/end times as desired.  Then just feed it to the schedule and it will display it in the proper spot.  And since you can derive from the Appointment class you can create different types of them as you require.  If you need the ability to setup steps for your planned items then the gantt would be a better fit I think.  What I mean by steps is, tasks need to be followed in order so you can't complete task 2 without having completed task 1 first.

Reply Children
No Data