|131986||Aug 7,2017 11:26 AM UTC||Aug 17,2017 02:02 PM UTC||Xamarin.Forms||7|
(using release 126.96.36.199)
Yesterday I tested the mentioned sample again. The sample works and shows the labels in the MonthViewCells as long as one does not set eg. the label text to eg. the appointment subject. So, in Schedule_MOnthCell_SamplePage.Schedule_InMonthCellLoadedEvent, if you replace
label.Text = "2";
label.Text = appointments.Subject;
then neither of both labels will be shown. The event handler will be executed, but it's result will be ignored and the default Cell content will be shown.
Since appointments is not null and appointments.Subject is the empty string I would at least expect that both labels would appear, the first one with empty text.
I think this might be a bug.
var appointments = e.appointments as ObservableCollection<object>;
foreach (var item in appointments)
button.Text = (item as ScheduleAppointment).Subject;
Thank you for your answer. It'll take two or three weeks before I can download and check the 15.3 release.
I'll write as soon as I've checked.
I managed to download the 15.3 release and made some tests.
Good news: appointments does contain the appointment data now, although appointments is not of type ScheduleAppointmentCpllection anymore but ObservableCollection<object>.
Bad news however, after assigning a View (StackLayout in this case) to args.View the App crashes as soon as the method returns, no matter if I assign data from the appointment or not.
Am I missing something or is this another bug?
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00073] in <bd30a18775d94dc8b6263aecd1ca9077>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in <bd30a18775d94dc8b6263aecd1ca9077>:0
at Android.Views.ViewGroup.Layout (System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00062] in <d855bac285f44dda8a0d8510b679b1e2>:0
at Xamarin.Forms.Platform.Android.ViewRenderer`2[TView,TNativeView].OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00059] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\ViewRenderer.cs:137
at Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System.Int32 p4) [0x00008] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240
at (wrapper dynamic-method) System.Object:fb76c2f6-e03b-4b81-a9c0-e343eba7a21b (intptr,intptr,bool,int,int,int,int)
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.