BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hello, I have a class like this
public class Meeting { public EventData Data{ get; set; } public string Title { get; set; } }
public class EventData { public DateTime From { get; set; } public DateTime To { get; set; } public bool IsAllDay { get; set; } public TimeZoneInfo StartTimeZone { get; set; } public TimeZoneInfo EndTimeZone { get; set; } public Brush Background { get; set; } }
ObservableCollection<Meeting> Events {get;set;}
XAML is like
...
<scheduler:SfScheduler x:Name="Scheduler" View="Week"
DisplayDate="{Binding DisplayDate}"
AppointmentsSource="{Binding Events}"
AllowedViews="Day,Week,WorkWeek,Month,TimelineDay,TimelineWeek,TimelineWorkWeek,TimelineMonth"
>
<scheduler:SfScheduler.AppointmentMapping>
<scheduler:SchedulerAppointmentMapping
Subject="Title" <-- WORK
StartTime="Data.From" <-- NOT WORK
EndTime="Data.To" <-- NOT WORK
IsAllDay="Data.IsAllDay"/> <-- NOT WORK
</scheduler:SfScheduler.AppointmentMapping>
</scheduler:SfScheduler>
Looks like the Mapping tools don't accept subclass.
Your help is appreciated
Thanks
Hi Alfonso,
#Regarding AppointmentMapping using a Subclass
According to the Scheduler's implementation, the appointment mapping only
allows direct properties from the model class. To map sub-class property values
from the model class, you need to create new properties and map the model
properties to the Scheduler. Check the code snippet below for an example.
Code Snippet
public class Meeting { public EventData Data { get; set; } public string Title { get; set; }
public DateTime From { get { return this.Data.From; } }
public DateTime To { get { return this.Data.To; } }
public bool IsAllDay { get { return this.Data.IsAllDay; } }
public Brush Background { get { return this.Data.Background; } } }
<scheduler:SfScheduler x:Name="Scheduler" View="Week" AppointmentsSource="{Binding Events}" DisplayDate="{Binding DisplayDate}" AllowedViews="Day,Week,WorkWeek,Month,TimelineDay,TimelineWeek,TimelineWorkWeek,TimelineMonth"> <scheduler:SfScheduler.AppointmentMapping> <scheduler:SchedulerAppointmentMapping Subject="Title" StartTime="From" EndTime="To" IsAllDay="IsAllDay"/> </scheduler:SfScheduler.AppointmentMapping> </scheduler:SfScheduler> |
Please let us know if you have any concerns.
Regards,
Karthik Raja A
Hi Karthik
Thank you for your quick response.
My workaround was very similar to your solutions, I do not like it, but it works!
Many thanks!
Alfonso
Hi Alfonso,
We are glad to know that the provided solution is resolved the query. Please let us know if you need any further assistance.