Calendar DayView freezing application on UWP

0 Answers 66 Views
Calendar & Scheduling
Marco
Top achievements
Rank 1
Marco asked on 14 Apr 2022, 09:01 AM

Hello, 

I have a problem regarding the Calendar DayView on UWP. The problem does not occur for my app on iOS or Android. When opening my page including the DayView the appointments are loaded correctly but the app is completly frozen and no further action can be taken. I tried multiple ways of loading the appointments and i will be posting my current setup below. For appointment loading i have tried the solution in the bug report https://feedback.telerik.com/xamarin/1497171-calendar-nullreferenceexception-when-setting-the-appointmentssource-in-uwp, which sadly does not fix the freezing problem.

Below is my code for the page:

View:


<pages:vContentPage
    x:Class="v.App.Views.AboutPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:pages="clr-namespace:v.App.Styling.Pages;assembly=v.App"
    xmlns:prism="http://prismlibrary.com"
    xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
    Title="About"
    prism:ViewModelLocator.AutowireViewModel="True"
    BackgroundColor="{DynamicResource ColorBackgroundPrimary}">
    <telerikInput:RadCalendar x:Name="calendar" 
                              ViewMode="Day"
                              NativeControlLoaded="MyCalendar_OnNativeControlLoaded">
        <telerikInput:RadCalendar.DayViewSettings>
            <telerikInput:DayViewSettings 
                DayStartTime="9:00:00"                                     
                DayEndTime="18:00:00"                                      
                TimelineInterval="2:00"                                      
                IsCurrentTimeIndicatorVisible="True"/>
        </telerikInput:RadCalendar.DayViewSettings>
    </telerikInput:RadCalendar>
</pages:vContentPage>

View.xaml.cs:

using System;
using System.Collections.ObjectModel;
using System.Drawing;
using Telerik.XamarinForms.Input;

namespace v.App.Views
{
    public partial class AboutPage 
    {
        public AboutPage()
        {
            InitializeComponent();
        }

        private void MyCalendar_OnNativeControlLoaded(object sender, EventArgs e)
        {
            var today = DateTime.Today;

            var items = new ObservableCollection<Appointment>
            {
                new Appointment {
                    Title = "Meeting with Tom",
                    Detail = "Sea Garden",
                    StartDate = today.AddHours(10),
                    EndDate = today.AddHours(11),
                    Color = Color.Tomato
                },
                new Appointment {
                    Title = "Lunch with Sara",
                    Detail = "Restaurant",
                    StartDate = today.AddHours(12).AddMinutes(30),
                    EndDate = today.AddHours(14),
                    Color = Color.DarkTurquoise
                },
                new Appointment {
                    Title = "Elle Birthday",
                    StartDate = today,
                    EndDate = today.AddHours(11),
                    Color = Color.Orange,
                    IsAllDay = true
                },
                    new Appointment {
                    Title = "Football Game",
                    StartDate = today.AddDays(2).AddHours(15),
                    EndDate = today.AddDays(2).AddHours(17),
                    Color = Color.Green
                }
            };

            (sender as RadCalendar).AppointmentsSource = items;
        }
    }
}

I have attached a screenshot from the loaded page aswell.

I am using the Telerik.UI.for.Xamarin Nuget-Package Version 2022.1.11.

Thank you in advance.

Yana
Telerik team
commented on 18 Apr 2022, 08:15 AM

Thank you for the provided snippet and screenshot.

I've tested the same Calendar scenario in a simple app and it worked properly on my side.  I would need a little bit more details on the overall setup you have. Please find attached my test app, do you reproduce the freezing issue with it? 

If possible, please send us a sample app reproducing the issue, so I can further research the reasons behind. 

I look forward to your reply.

Marco
Top achievements
Rank 1
commented on 22 Apr 2022, 11:02 AM

Hello Yana,

thank you for taking time answering my question!

Through your sample app I was able to resolve my issue. The issue was produced by the UWP min version, which was not correctly set for our app. Through changing the min version of our app the issue was resolved.

Best regards

No answers yet. Maybe you can help?

Tags
Calendar & Scheduling
Asked by
Marco
Top achievements
Rank 1
Share this question
or