/// <summary>
        /// Month inline appointment loaded event
        /// </summary>
        /// <param name="sender">return the object</param>
        /// <param name="e">Month Inline Appointment Loaded Event Args</param>
        private void BindableOnMonthInlineAppointmentLoadedEvent(object sender, MonthInlineAppointmentLoadedEventArgs e)
        {
            Button button = new Button();

            button.TextColor         = Color.White;
            button.VerticalOptions   = LayoutOptions.FillAndExpand;
            button.HorizontalOptions = LayoutOptions.FillAndExpand;

            if (Device.RuntimePlatform == "UWP")
            {
                button.WidthRequest  = 250;
                button.HeightRequest = 50;
            }

            if ((e.appointment as ScheduleAppointment).Subject == "Conference")
            {
                button.BackgroundColor = Color.FromHex("#FFD80073");
                button.Text            = "Conference";
                button.Image           = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.conference_schedule.png");
            }
            else if ((e.appointment as ScheduleAppointment).Subject == "Checkup")
            {
                button.BackgroundColor = Color.FromHex("#FFA2C139");
                button.Text            = "Checkup";
                button.Image           = ImagePathConverter.GetImageSource("SampleBrowser.SfSchedule.stethoscope_schedule.png");
            }

            if (!(e.appointment as ScheduleAppointment).IsAllDay)
            {
                e.view = button;
            }
        }
Example #2
0
        private void Schedule_MonthInlineAppointmentLoaded(object sender, MonthInlineAppointmentLoadedEventArgs e)
        {
            UIView mainView = new UIView();

            mainView.BackgroundColor = UIColor.FromRGB(221, 221, 221);
            mainView.Frame           = new RectangleF(0, 0, (float)UIScreen.MainScreen.Bounds.Size.Width, 40);

            UIView view = new UIView();

            view.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            view.Frame           = new RectangleF(0, 0, (float)mainView.Frame.Size.Width, 38);

            UITextView startTime = new UITextView();

            startTime.Text            = DateTime.Parse(e.Appointment.StartTime.ToString()).ToString("hh:mm tt");
            startTime.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            startTime.TextColor       = UIColor.FromRGB(0, 0, 0);
            startTime.Frame           = new RectangleF(0, 0, ((float)mainView.Frame.Size.Width), (float)17.5);
            startTime.Font            = UIFont.SystemFontOfSize(8, UIFontWeight.Bold);

            UITextView endTime = new UITextView();

            endTime.Text            = DateTime.Parse((e.Appointment.EndTime.ToString())).ToString("hh:mm tt");
            endTime.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            endTime.TextColor       = UIColor.FromRGB(0, 0, 0);
            endTime.Frame           = new RectangleF(0, 20, ((float)mainView.Frame.Size.Width), (float)17.5);
            endTime.Font            = UIFont.SystemFontOfSize(8, UIFontWeight.Bold);

            UITextView subject = new UITextView();

            subject.Text            = e.Appointment.Subject.ToString();
            subject.TextColor       = UIColor.FromRGB(0, 0, 0);
            subject.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            subject.Frame           = new RectangleF(100, 5, (float)mainView.Frame.Size.Width, 30);
            subject.Font            = UIFont.SystemFontOfSize(12, UIFontWeight.Bold);

            view.AddSubview(startTime);
            view.AddSubview(endTime);
            view.AddSubview(subject);

            mainView.AddSubview(view);
            e.View = mainView;
        }