Add a button to the Agenda or Inline Appointments container

When the Appointments for a day are displayed is it possible to display a single button in that View\Container? I'd like to have a button that could be used to navigate to a new page to do a full summary of that day


3 Replies

MS Muniappan Subramanian Syncfusion Team July 21, 2021 01:34 PM UTC

Hi Pat,  
 
Thank you for contacting Syncfusion support.  
 
We have checked your requirement“Add a button to the Agenda or Inline Appointments container”. You can achieve your requirement by customizing the AgendaView in calendar. we have prepared a simple sample for the same, please find the sample link form below, 
 
 
Please refer the below Ug link for more details about custom agenda view in calendar, 
 
We hope that this helps you, kindly revert us if you have any concern.  
 
Regards, 
Muniappan S. 



PA Pat July 22, 2021 03:37 PM UTC

Can you confirm that when you are answering the question "How to show events in custom agenda view using list view in Xamarin.Forms Calendar?" the custom Agenda View you are referring to is in fact just a ListView created outside of the Syncfusion Controls wih a coinsiderable amount of custom code in a Behavior?


To be honest if I was going to create my own list of events for the selected day wouldn't I just bind to my own Interface type from my ViewModel? What am I mis




MS Muniappan Subramanian Syncfusion Team July 23, 2021 10:51 AM UTC

Hi Pat,  
 
Thank you for update. 
 
We have checked your requirement “Add a button to the Agenda or Inline Appointments containerl in SfCalendar”. You can achieve your requirement by customizing the inline view using the “OnInlineLoaded” event of SfCalendar. we have prepared a simple sample for the same, please find the sample link form below, 
 
Code snippet: 
private void Calendar_OnInlineLoaded(object sender, InlineEventArgs e) 
{ 
    var appView = new StackLayout(); 
    appView.Padding = new Thickness(0, 10, 0, 0); 
    appView.Orientation = StackOrientation.Vertical; 
    for (int i = 0; i < e.Appointments.Count; i++) 
    { 
        var appointment = e.Appointments[i] as CalendarInlineEvent; 
        var frame = new Frame(); 
        frame.HasShadow = true; 
        frame.IsClippedToBounds = true; 
        frame.Padding = new Thickness(0, 0, 0, 0); 
        frame.CornerRadius = 30; 
        if (Device.RuntimePlatform == Device.iOS) 
        { 
            frame.CornerRadius = 10; 
        } 
        frame.BackgroundColor = appointment.Color; 
        frame.Margin = new Thickness(50, 0, 0, 0); 
 
        var appointmentLayout = new StackLayout(); 
 
        Label subject = new Label(); 
        subject.Text = appointment.Subject; 
        subject.FontSize = 10; 
        subject.Padding = new Thickness(10, 0, 0, 0); 
 
        Label appTime = new Label(); 
        appTime.FontSize = 10; 
        appTime.Padding = new Thickness(10, 0, 0, 0); 
        appTime.Text = appointment.StartTime.ToString("hh:mm tt") + " - " + appointment.EndTime.ToString("hh:mm tt"); 
 
        appointmentLayout.Children.Add(subject); 
        appointmentLayout.Children.Add(appTime); 
 
        frame.Content = appointmentLayout; 
        appView.Children.Add(frame); 
    } 
 
    var navigateButton = new Button(); 
    navigateButton.Text = "Navigate"; 
    appView.Children.Add(navigateButton); 
 
    var scrollView = new ScrollView(); 
    scrollView.Content = appView; 
 
    e.View = scrollView; 
} 
 
 
 
We hope that this helps you, kindly revert us if you have any concern.  
 
Regards, 
Muniappan S. 


Loader.
Up arrow icon