Example #1
0
 public NewMenuCommand(IMainWindow mainWindow,
                       IRemindersManager remindersManager)
     : this(mainWindow,
            remindersManager,
            null)
 {
 }
        public void MakeNewReminder(IRemindersManager _remindersManager)
        {
            var form = new AddEditReminderForm(_remindersManager);

            form.Owner = this;
            form.ShowDialog();
        }
 public void ReminderNotification(IRemindersManager remindersManager, Reminder reminder)
 {
     Application.Current.Dispatcher.Invoke((Action) delegate {
         var form   = new ReminderNotification(remindersManager, reminder);
         form.Owner = this;
         form.Show();
     });
 }
        public ReminderNotification(IRemindersManager remindersManager, Reminder reminder)
        {
            InitializeComponent();

            _remindersManager = remindersManager;
            _reminder         = reminder;

            viewReminder.DataContext = _reminder;
        }
        public RemoveReminderMenuCommand(IRemindersManager remindersManager, IRemindersListView remindersListView, IEnumerable <IMenuCommand> subCommands) : base(subCommands)
        {
            _remindersManager  = remindersManager;
            _remindersListView = remindersListView;
            Header             = "Remove";

            IsEnabled = false;

            EventAggregator.Instance.Subscribe <ReminderIsSelectedEventAggregator>(r => IsEnabled = r.IsSelected);
        }
Example #6
0
        public NewMenuCommand(IMainWindow mainWindow,
                              IRemindersManager remindersManager,
                              IEnumerable <IMenuCommand> subCommands) : base(subCommands)
        {
            _mainWindow       = mainWindow;
            _remindersManager = remindersManager;

            Header      = "New";
            ShortcutKey = System.Windows.Input.Key.N;
        }
        public SaveMenuCommand(IRemindersManager remindersManager, IEnumerable <IMenuCommand> subCommands) : base(subCommands)
        {
            _remindersManager = remindersManager;

            Header = "Save";

            IsEnabled = false;

            EventAggregator.Instance.Subscribe <RemindersManagerIsChangedEventAggregator>(e => { IsEnabled = e.IsChanged && e.RemindersFileIsSet; });
        }
Example #8
0
        public OpenMenuCommand(IMainWindow mainWindow,
                               IRemindersManager remindersManager,
                               IEnumerable <IMenuCommand> subCommands) : base(subCommands)
        {
            _mainWindow       = mainWindow;
            _remindersManager = remindersManager;

            Header      = "Open";
            ShortcutKey = System.Windows.Input.Key.O;

            Filter      = "XML (*.xml)|*.xml";
            Multiselect = false;
        }
        public SaveAsMenuCommand(IMainWindow mainWindow, IRemindersManager remindersManager, IEnumerable <IMenuCommand> subCommands)
            : base(subCommands)
        {
            _mainWindow       = mainWindow;
            _remindersManager = remindersManager;

            Header = "Save As";

            IsEnabled = false;

            Filter = "XML (*.xml)|*.xml";

            EventAggregator.Instance.Subscribe <RemindersManagerIsChangedEventAggregator>(e => IsEnabled = e.IsChanged);
        }
        public EditReminderMenuCommand(IMainWindow mainWindow,
                                       IRemindersManager remindersManager,
                                       IRemindersListView reminderListView,
                                       IEnumerable <IMenuCommand> subCommands) :
            base(subCommands)
        {
            _mainWindow       = mainWindow;
            _remindersManager = remindersManager;
            _reminderListView = reminderListView;
            Header            = "Edit";

            IsEnabled = false;

            EventAggregator.Instance.Subscribe <ReminderIsSelectedEventAggregator>(r => IsEnabled = r.IsSelected);
        }
        public AddEditReminderForm(IRemindersManager remindersManager, Reminder reminder)
        {
            _remindersManager = remindersManager;

            InitializeComponent();

            if (reminder == null)
            {
                _reminder     = new Reminder();
                _isNew        = true;
                btnOk.Content = "Add";
            }
            else
            {
                _reminderToEdit = reminder;
                _reminder       = new Reminder();

                Reminder.Copy(reminder, _reminder);
            }

            grid1.DataContext = _reminder;
        }
 public EditReminderMenuCommand(IMainWindow mainWindow,
                                IRemindersManager remindersManager,
                                IRemindersListView reminderListView) :
     this(mainWindow, remindersManager, reminderListView, null)
 {
 }
 public void SetNumberOfReminders(IRemindersManager remindersManager)
 {
     NumberOfReminders.Content = $"Number of reminders: {remindersManager.Reminders.Count()} ";
 }
 public AddEditReminderForm(IRemindersManager remindersManager) : this(remindersManager, null)
 {
 }
 public RemoveReminderMenuCommand(IRemindersManager remindersManager, IRemindersListView remindersListView) : this(remindersManager, remindersListView, null)
 {
 }
 public AddNewReminderMenuCommand(IMainWindow mainWindow, IRemindersManager remindersManager, IEnumerable <IMenuCommand> subCommands) : base(subCommands)
 {
     _mainWindow       = mainWindow;
     _remindersManager = remindersManager;
     Header            = "Add";
 }
Example #17
0
 public SaveMenuCommand(IRemindersManager remindersManager) : this(remindersManager, null)
 {
 }