private void OnMouseDoubleClickOnTaskGridRow(object sender, MouseButtonEventArgs e)
        {
            // check if the row is double-clicked
            DependencyObject dep = (DependencyObject)e.OriginalSource;

            while ((dep != null) && !(dep is DataGridCell))
            {
                dep = VisualTreeHelper.GetParent(dep);
            }
            if (dep == null)
            {
                return;
            }

            try
            {
                Mission task = this.taskGrid.SelectedItem as Mission;

                DateTime date = task.Date;

                try
                {
                    date = this.Calendar.SelectedDate.Value;
                }
                catch (Exception)
                {
                    date = task.Date;
                }

                var createTaskWindow = new CreateTaskWindow(date, task);
                createTaskWindow.Owner = this;
                createTaskWindow.ShowDialog();

                createTaskWindow.Closed += (objectSender, eventArgs) =>
                {
                    RefreshGeradContent();
                };

                RefreshGeradContent();
            }
            catch (Exception)
            {
                // throw;
            }

            this.taskGrid.SelectedItem = null;
            this.Calendar.SelectedDate = null;

            //MessageBoxResult result = MessageBox.Show("Hello MessageBox");
        }
        private void OnCreateTaskClick(object sender, RoutedEventArgs e)
        {
            var createTaskWindow = new CreateTaskWindow(DateTime.Now);

            createTaskWindow.Owner = this;
            createTaskWindow.ShowDialog();

            createTaskWindow.Closed += (objectSender, eventArgs) =>
            {
                RefreshGeradContent();
            };

            RefreshGeradContent();
        }
        private void Calendar_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedDate = Calendar.SelectedDate.Value;
            var createTaskWindow = new CreateTaskWindow(selectedDate);
            createTaskWindow.Owner = this;
            createTaskWindow.ShowDialog();

            createTaskWindow.Closed += (objectSender, eventArgs) =>
            {
                RefreshGeradContent();
            };

            RefreshGeradContent();
            this.taskGrid.SelectedItem = null;
            this.Calendar.SelectedDate = null;
        }
        private void Calendar_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedDate     = Calendar.SelectedDate.Value;
            var createTaskWindow = new CreateTaskWindow(selectedDate);

            createTaskWindow.Owner = this;
            createTaskWindow.ShowDialog();

            createTaskWindow.Closed += (objectSender, eventArgs) =>
            {
                RefreshGeradContent();
            };

            RefreshGeradContent();
            this.taskGrid.SelectedItem = null;
            this.Calendar.SelectedDate = null;
        }
        private void OnMouseDoubleClickOnTaskGridRow(object sender, MouseButtonEventArgs e)
        {
            // check if the row is double-clicked
            DependencyObject dep = (DependencyObject)e.OriginalSource;
            while ((dep != null) && !(dep is DataGridCell))
            {
                dep = VisualTreeHelper.GetParent(dep);
            }
            if (dep == null) return;

            try
            {
                Mission task = this.taskGrid.SelectedItem as Mission;

                DateTime date = task.Date;

                try
                {
                    date = this.Calendar.SelectedDate.Value;
                }
                catch (Exception)
                {
                    date = task.Date;
                }

                var createTaskWindow = new CreateTaskWindow(date, task);
                createTaskWindow.Owner = this;
                createTaskWindow.ShowDialog();

                createTaskWindow.Closed += (objectSender, eventArgs) =>
                {
                    RefreshGeradContent();
                };

                RefreshGeradContent();
            }
            catch (Exception)
            {
                // throw;
            }

            this.taskGrid.SelectedItem = null;
            this.Calendar.SelectedDate = null;

            //MessageBoxResult result = MessageBox.Show("Hello MessageBox");
        }
        private void OnCreateTaskClick(object sender, RoutedEventArgs e)
        {
            var createTaskWindow = new CreateTaskWindow(DateTime.Now);
            createTaskWindow.Owner = this;
            createTaskWindow.ShowDialog();

            createTaskWindow.Closed += (objectSender, eventArgs) =>
            {
                RefreshGeradContent();
            };

            RefreshGeradContent();
        }