2016-09-29 19 views
0

私はそれが私にこのエラー与えページ開こうとすると、私はSyncfusion毎週SfScheduleを含むページがあります。XamarinはSystem.Reflection.TargetInvocationExceptionフォーム:呼び出しのターゲットが例外をスローされた

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation and the InnerException is: {System.ArgumentOutOfRangeException}. The App crashes on InitializeComponent(); line.

私は自分のレルムデータベースからスケジュールのデータソースを満たしています。

これは、XAMLコードです:

<ContentPage.Padding> 
    <OnPlatform x:TypeArguments="Thickness" 
      iOS="0, 20, 0, 0" 
      Android="0" 
      WinPhone="0" /> 
</ContentPage.Padding> 

<ContentPage.BindingContext> 
    <ViewModels:ActivitiesViewModel/> 
</ContentPage.BindingContext> 

<WeeklySchedule:SfSchedule x:Name="activitiesWeeklySchedule" 
         BackgroundColor="White" 
         HorizontalOptions="FillAndExpand" 
         VerticalOptions="FillAndExpand" 
         ScheduleView="WeekView" 
         ShowAppointmentsInline="True"> 
</WeeklySchedule:SfSchedule> 

そして、これは背後にあるコードです:

Realm realm; 
    ScheduleAppointmentCollection collection; 
    public TeacherWeeklyView() { 
     InitializeComponent(); 
     collection = new ScheduleAppointmentCollection() { }; 
     var config = new RealmConfiguration() { SchemaVersion = 3 }; 
     realm = Realm.GetInstance(config); 
     var activities = realm.All<ActivitiesItems>(); 
     foreach (var item in activities) { 
      System.Diagnostics.Debug.WriteLine(item.ActivitySubject); 
      collection.Add(activity); 
     } 
     activitiesWeeklySchedule.DataSource = collection; 
    } 

Syncfusionパッケージは、私はそれを更新しましたが、何も変わっていないので、更新することが必要なときに、この問題が開始。

答えて

0

私はこのコードの一部を削除し、それを固定:

<ContentPage.BindingContext> 
    <ViewModels:ActivitiesViewModel/> 
</ContentPage.BindingContext> 
関連する問題