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
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
|
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;
}
|