Exemple #1
0
        /// <summary>
        /// Call this constructor when you come from a pushed message
        /// </summary>
        /// <param name="anAppointmentID"></param>
        public AppointmentEdit(Guid anAppointmentID)
        {
            InitializeComponent();
            if (ViewModelOverview.Appointments == null)
            {
                new ViewModelOverview();
            }

            Appointment appointment = ViewModelOverview.GetAppointment(anAppointmentID);

            _viewModel = new ViewModelAppointmentEdit(appointment);
            addToolbarItems();
            bindData();
        }
Exemple #2
0
        public AppointmentOverview()
        {
            InitializeComponent();

            viewModel = new ViewModelOverview();
            // Item-Binding in Code, all Appointments in the Lists are Displayed in the GUI.
            PlannedAppointmentList.ItemsSource = viewModel.PlannedAppointments;
            DoneAppointmentList.ItemsSource    = viewModel.DoneAppointments;
            FixedAppointmentList.ItemsSource   = viewModel.FixedAppointments;
            //// Attaching ChangeListeners
            //viewModel.PlannedAppointments.CollectionChanged += PlannedAppointments_CollectionChanged;
            //viewModel.FixedAppointments.CollectionChanged += FixedAppointments_CollectionChanged; ;
            //viewModel.DoneAppointments.CollectionChanged += DoneAppointments_CollectionChanged;
            //// At Load-Time we want to actually load the list which happens on Change.
            //PlannedAppointments_CollectionChanged(null, null);
            //FixedAppointments_CollectionChanged(null, null);
            //DoneAppointments_CollectionChanged(null, null);
            //Displays a button in the navbar to add a new Appointment
            ToolbarItems.Add(new ToolbarItem(Multilanguage.TranslateExtension.getString("addNewAppointment"), "", async() =>
            {
                var edit = new AppointmentEdit();
                await Navigation.PushAsync(edit);
            }));
        }