Beispiel #1
0
 public EditGoalWindow(Goal goal)
 {
     InitializeComponent();
     EditedGoal = goal;
     ReminderPicker.SelectedDateChanged += ReminderPicker_SelectedDateChanged;
     GoalEdited += RedrawTextFields;
     GoalEdited += FillLabelsAttachmentsCheckboxes;
     GoalEdited?.Invoke();
 }
Beispiel #2
0
        private void AddAttachmentButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == true)
            {
                EditedGoal.AttachmentFilePaths.Add(dialog.FileName);
                GoalEdited?.Invoke();
            }
        }
Beispiel #3
0
        private void RemoveAttachment(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var label = sender as TextBlock;

            if (label != null)
            {
                var clickedLabel = EditedGoal.AttachmentFilePaths.FirstOrDefault(x => x.Equals(label.Text));
                EditedGoal.AttachmentFilePaths.Remove(clickedLabel);
                GoalEdited?.Invoke();
            }
        }
Beispiel #4
0
        private void AddLabel_Click(object sender, RoutedEventArgs e)
        {
            Dialog dialog = new Dialog("Label Name");

            dialog.ShowDialog();
            if (dialog.DialogResult == true)
            {
                EditedGoal.Labels.Add(dialog.TextF);
                GoalEdited?.Invoke();
            }
        }