Beispiel #1
0
        public void AddTappedDayAppointments()
        {
            if (App.ViewModel.SingleDayViewModel.TappedDay == null)
            {
                return;
            }

            foreach (PocalAppointment pa in App.ViewModel.SingleDayViewModel.TappedDay.PocalApptsOfDay)
            {
                if (!pa.AllDay)
                {
                    SDV_Appointment_Control control = new SDV_Appointment_Control();
                    control.DataContext = pa;
                    GridAppointments.Children.Add(control);
                }
            }
        }
Beispiel #2
0
        public void Update_PocalAppointment(PocalAppointment oldPA, PocalAppointment newPA)
        {
            for (int i = GridAppointments.Children.Count - 1; i >= 0; i--)
            {
                FrameworkElement item = GridAppointments.Children[i] as FrameworkElement;
                if (item.DataContext == oldPA)
                {
                    GridAppointments.Children.Remove(item);
                }
            }

            if (newPA != null && newPA.AllDay == false && newPA.StartTime.Date == App.ViewModel.SingleDayViewModel.TappedDay.Dt.Date)
            {
                //fixme
                newPA = App.ViewModel.SingleDayViewModel.TappedDay.PocalApptsOfDay.FirstOrDefault(x => x.Appt.LocalId == newPA.Appt.LocalId);
                SDV_Appointment_Control control = new SDV_Appointment_Control();
                control.DataContext = newPA;
                GridAppointments.Children.Add(control);
            }
        }