I have a custom template for my Appointments , the main problem is Touch events are not working
I can click or double click in my custom Appointment but I can not select the appointments with touch.
Here is my xaml.
My DataTemplate to fill the content
<DataTemplate x:Key="PatientAppointmentDataTemplate">
<Grid MinHeight="150">
<---> Content
</Grid>
</DataTemplate>
My Selector.
<selectors:AppointmentSelector x:Key="DefaultAppointmentStyleSelector">
<selectors:AppointmentSelector.TodayAppointmentSelector>
<Style TargetType="telerik:AppointmentItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:AppointmentItem">
<ContentControl DataContext="{Binding .}">
<i:Interaction.Triggers>
///HACK TO FORCE TO SELECT AN APPOINTMENT
<i:EventTrigger EventName="TouchDown" SourceObject="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:AppointmentItem}}}">
<ei:ChangePropertyAction PropertyName="SelectedAppointment"
TargetObject="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type telerik:RadScheduleView}}}"
Value="{Binding}" />
<i:InvokeCommandAction Command="telerik:RadScheduleViewCommands.EditAppointment" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid x:Name="Root"
Background="Gray"
Focusable="True">
<Grid.InputBindings>
<MouseBinding Command="telerik:RadScheduleViewCommands.EditAppointment" MouseAction="LeftDoubleClick" />
</Grid.InputBindings>
<ContentPresenter ContentTemplate="{StaticResource PatientAppointmentDataTemplate}" />
</Grid>
</ContentControl>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</selectors:AppointmentSelector.TodayAppointmentSelector>
My Slots have IsReadOnly= False.
I handled ShowDialog to personalize the edit or delete appointments.
this.scheduleView.ShowDialog += scheduleView_ShowDialog;
private async void scheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
e.Cancel = true;
/// My code
}
But this event does not fire too, when I do double touch simulating MouseDoubleClick.
Please help me. Thank you.
I can click or double click in my custom Appointment but I can not select the appointments with touch.
Here is my xaml.
My DataTemplate to fill the content
<DataTemplate x:Key="PatientAppointmentDataTemplate">
<Grid MinHeight="150">
<---> Content
</Grid>
</DataTemplate>
My Selector.
<selectors:AppointmentSelector x:Key="DefaultAppointmentStyleSelector">
<selectors:AppointmentSelector.TodayAppointmentSelector>
<Style TargetType="telerik:AppointmentItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:AppointmentItem">
<ContentControl DataContext="{Binding .}">
<i:Interaction.Triggers>
///HACK TO FORCE TO SELECT AN APPOINTMENT
<i:EventTrigger EventName="TouchDown" SourceObject="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:AppointmentItem}}}">
<ei:ChangePropertyAction PropertyName="SelectedAppointment"
TargetObject="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type telerik:RadScheduleView}}}"
Value="{Binding}" />
<i:InvokeCommandAction Command="telerik:RadScheduleViewCommands.EditAppointment" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid x:Name="Root"
Background="Gray"
Focusable="True">
<Grid.InputBindings>
<MouseBinding Command="telerik:RadScheduleViewCommands.EditAppointment" MouseAction="LeftDoubleClick" />
</Grid.InputBindings>
<ContentPresenter ContentTemplate="{StaticResource PatientAppointmentDataTemplate}" />
</Grid>
</ContentControl>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</selectors:AppointmentSelector.TodayAppointmentSelector>
My Slots have IsReadOnly= False.
I handled ShowDialog to personalize the edit or delete appointments.
this.scheduleView.ShowDialog += scheduleView_ShowDialog;
private async void scheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
e.Cancel = true;
/// My code
}
But this event does not fire too, when I do double touch simulating MouseDoubleClick.
Please help me. Thank you.