Xamarin.Forms Calendar and ListView using Office365 and Outlook API

2 posts, 0 answers
  1. Nathan
    Nathan avatar
    1 posts
    Member since:
    Aug 2016

    Posted 04 Aug 2016 Link to this post


    I'm looking for a control that can use the Office365/Outlook API to add, edit and delete the data.

    I've stumbled across the Xamarin Telerik Calendar and ListView. I'm just wondering if I can bind the users data from the authenticated account into these controls. I've managed to auth the user and add the control to a tabbed page but I'm a little stuck on how to bind the data into the controls.

    Good reads or samples would be great. 

  2. Lance | Manager Technical Support
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 08 Aug 2016 Link to this post

    Hello Nathan,

    The UI for Xamarin Calendar has a property "AppointmentsSource", which can use a collection of objects that implement the IAppointment interface. The interface has three properties that you need to implement in your model:

    pubic interface IAppointment
        public DateTime StartDate  { get; set; }
        public DateTime EndDate  { get; set; }
        public string Title  { get; set; }

    It doesn't matter where your data comes from, it could be from an O365 API or manually created in the app, as long as you implement the interface you can use the Calendar to show the appointments.

    See here for an example of implementing it.

    From what I can tell about the O365 API Calendar Event object (aka Appointment), you get a Start, an End and a Subject value for each of the Events that are returned. This means you have the minimum needed to fulfill the IAppointment's requirements.

    Here's a pseudo-code example of what that would look like (we cannot see your model, and editing it directly is out-of-scope for Telerik support). To accomodate the Calendar, just return the properties that are already there for the O365 object)

    public class MyO365EventModel : IAppointment, INotifyPropertyChanged
        public DateTime Start {get; set;}
        public DateTime End {get;set;}
        public string Subject [get;set;}
        //properties needed to implement IAppointment
        public DateTime StartDate
            get { return this.Start ; }
            set { this.Start = value; OnPropertyChanged}
         //repeat similar approach for EndDate and Title (I would point Title at "Subject")

    Please let us know if you have any further questions. Thank you for contacting Support and for choosing Telerik by Progress.

    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top