Exception on Custom Appointments

Hello,

I try to create Custom Appointment and paste and copy your code-snippet in my project:


But if I set the collection to the schedule I get an exception: "System.ArgumentNullException": Value cannot be null. Parameter name: fromDate

You can test you example-code in the version 16.3.0.21.

Following the complete StackTrace:
  at Foundation.NSCalendar.Components (Foundation.NSCalendarUnit unitFlags, Foundation.NSDate fromDate) [0x00003] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/Foundation/NSCalendar.g.cs:127 
  at Syncfusion.SfSchedule.iOS.ScheduleHelper.ConvertNSDateToDateTime (Foundation.NSDate calendar) [0x00005] in <e63d7725cbea4a3ea85fdfadec10606c>:0 
  at Syncfusion.SfSchedule.iOS.AppointmentEngine.GenerateScheduleAppointments (System.Collections.IEnumerable itemsSource, Syncfusion.SfSchedule.iOS.AppointmentMapping appointmentMapping) [0x00056] in <e63d7725cbea4a3ea85fdfadec10606c>:0 
  at Syncfusion.SfSchedule.iOS.SFSchedule.GenerateAppointments () [0x00012] in <e63d7725cbea4a3ea85fdfadec10606c>:0 
  at Syncfusion.SfSchedule.iOS.SFSchedule.set_ItemsSource (System.Collections.IEnumerable value) [0x0000f] in <e63d7725cbea4a3ea85fdfadec10606c>:0 
  at Syncfusion.SfSchedule.XForms.iOS.Mapping.SfScheduleMapping.OnSfSchedulePropertiesChanged (System.String propertyName, Syncfusion.SfSchedule.XForms.SfSchedule formSfSchedule, Syncfusion.SfSchedule.iOS.SFSchedule nativeSchedule, Syncfusion.SfSchedule.XForms.iOS.SfScheduleRenderer scheduleRenderer) [0x00164] in <049f7d3dabb9424cb5fa5a8902b1b154>:0 
  at Syncfusion.SfSchedule.XForms.iOS.SfScheduleRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00030] in <049f7d3dabb9424cb5fa5a8902b1b154>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:370 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at Syncfusion.SfSchedule.XForms.SfSchedule.set_DataSource (System.Collections.IEnumerable value) [0x00000] in <a36559b5d41b41d2a591349b390a6dd0>:0 
  at GinkgoMobile.Pages.Kalender.KalenderView.SetKalenderGruppe (Modules.Cross.Kalender.Models.KalenderGruppeViewModel kgvm) [0x00058] in /Users/stephanblaurock/Projects/GinkgoMobile/GinkgoMobile/Pages/Kalender/KalenderView.xaml.cs:88 
  at GinkgoMobile.Pages.Kalender.KalenderPagePhone._NavigatorView_KalenderGruppeViewModelChanged (System.Object sender, System.EventArgs e) [0x0000a] in /Users/stephanblaurock/Projects/GinkgoMobile/GinkgoMobile/Pages/Kalender/KalenderPagePhone.xaml.cs:35 
  at GinkgoMobile.Pages.Kalender.NavigatorView.Handle_ItemTapped (System.Object sender, Xamarin.Forms.ItemTappedEventArgs e) [0x0000d] in /Users/stephanblaurock/Projects/GinkgoMobile/GinkgoMobile/Pages/Kalender/NavigatorView.xaml.cs:30 
  at Xamarin.Forms.ListView.NotifyRowTapped (System.Int32 groupIndex, System.Int32 inGroupIndex, Xamarin.Forms.Cell cell) [0x00075] in D:\a\1\s\Xamarin.Forms.Core\ListView.cs:424 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource.RowSelected (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x0006f] in <66855f87e3b64ff38a3e1034f86d8129>:0 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63 
  at GinkgoMobile.iOS.Application.Main (System.String[] args) [0x00001] in /Users/stephanblaurock/Projects/GinkgoMobile/GinkgoMobile.iOS/Main.cs:14 

Thank you for your help!

3 Replies

VR Vigneshkumar Ramasamy Syncfusion Team October 3, 2018 08:49 AM UTC

Hi Stephan 

Thanks for contacting Syncfusion support. 
 
We are not able to reproduce the “Exception on custom appointments” issue, we have prepared a simple sample based on your requirement we also copy paste the code from our UG(https://help.syncfusion.com/xamarin/sfschedule/data-bindings#creating-custom-appointments


 
Please find the sample below: 
 
Please check the above attached sample ,still if you face any issues please revert us with more information so that we could analyze further and provide you the possible solution. 
 
Regards,
Vigneshkumar R 



SB Stephan Blaurock October 5, 2018 01:01 PM UTC

Hello,

thanks for your test-project. Now I found my mistake - I set the end-tag-character of the mapping-tag wrong:

<syncfusion:ScheduleAppointmentMapping> 
                        SubjectMapping="EventName"
                        StartTimeMapping="From"
                        EndTimeMapping="To"
</syncfusion:ScheduleAppointmentMapping>


now with this version it works fine :-)
<syncfusion:ScheduleAppointmentMapping 
                        SubjectMapping="EventName"
                        StartTimeMapping="From"
                        EndTimeMapping="To">
</syncfusion:ScheduleAppointmentMapping>
Sorry and thanks


VR Vigneshkumar Ramasamy Syncfusion Team October 8, 2018 07:03 AM UTC

Hi Stephan  
 
We glad to know that your requirement has been achieved. Please get in touch if you required further assistance on this. 
   
Regards 
Vigneshkumar R 


Loader.
Up arrow icon