Esempio n. 1
0
        private void ShowEditEventDialog(EventControl target)
        {
            this.attachedPopup.PlacementTarget = target;
            EditEventDialog editPopupDialog = new EditEventDialog();
            editPopupDialog.FillData(target.DataSource);
            editPopupDialog.DialogTitleTextBlock.Text = "Edit";
            editPopupDialog.SubmitButton.Content = "Apply";
            editPopupDialog.SubmitButton.Click += new System.Windows.RoutedEventHandler(this.EditDialogSubmitButton_Clicked);
            editPopupDialog.EventPopupCloseButton.Click += new System.Windows.RoutedEventHandler(this.DialogCloseButton_Clicked);

            this.attachedPopup.Width = editPopupDialog.Width;
            this.attachedPopup.Height = editPopupDialog.Height;
            this.attachedPopup.Child = editPopupDialog;

            this.attachedPopup.IsOpen = true;
        }
Esempio n. 2
0
        private void ShowCreateDialog(Rectangle target)
        {
            const int FirstHourCellRow = WeekGridControl.FirstHourCellRow;
            const int FirstHourCellColumn = WeekGridControl.FirstHourCellColumn;

            //Get row/column of the cell that got clicked
            int cellRow = Grid.GetRow(target);
            int cellColumn = Grid.GetColumn(target);

            //Calculate start/end of the new event based on the cell position.
            DateTime newEventStart = masterDispatcher.WeekOnFocusStart.AddDays(cellColumn - FirstHourCellColumn)
                                         .AddHours(cellRow - FirstHourCellRow);
            DateTime newEventEnd = newEventStart.AddHours(1);

            this.attachedPopup.PlacementTarget = target;
            EditEventDialog editPopupDialog = new EditEventDialog();
            editPopupDialog.FillData(String.Empty, String.Empty, OrganizerEventType.Other, newEventStart, newEventEnd, false);
            editPopupDialog.DialogTitleTextBlock.Text = "Create";
            editPopupDialog.SubmitButton.Content = "Create";
            editPopupDialog.SubmitButton.Click += new System.Windows.RoutedEventHandler(this.CreateDialogSubmitButton_Clicked);
            editPopupDialog.EventPopupCloseButton.Click += new System.Windows.RoutedEventHandler(this.DialogCloseButton_Clicked);

            this.attachedPopup.Width = editPopupDialog.Width;
            this.attachedPopup.Height = editPopupDialog.Height;
            this.attachedPopup.Placement = PlacementMode.Top;
            this.attachedPopup.Child = editPopupDialog;

            this.attachedPopup.IsOpen = true;
        }