示例#1
0
        public MainWindow()
        {
            NormalizeWindiwSetting.Normalize(typeof(MainWindow));
            InitializeComponent();
            taskControl = new WorkTasksViewModel();
            taskControl.LoadActive(new object());
            taskControl.StartTimer();
            DataContext = taskControl;

            notifyIcon = new NotifyIcon
            {
                Text    = "Планировщик задач",
                Icon    = Properties.Resources.icon, // new System.Drawing.Icon(Properties.Resources.icon),
                Visible = true
            };
            notifyIcon.DoubleClick += NotifyIcon_Click;
            ContextMenuStrip notifyContextMenu = new ContextMenuStrip();
            var newTaskButton = notifyContextMenu.Items.Add("Новая задача.");

            newTaskButton.Click += NewTaskButton_Click;;
            var closeButton = notifyContextMenu.Items.Add("Закрыть.");

            closeButton.Click          += CloseButton_Click;
            notifyIcon.ContextMenuStrip = notifyContextMenu;
        }
 public NewReminderWindow()
 {
     NormalizeWindiwSetting.Normalize(typeof(NewReminderWindow));
     InitializeComponent();
     result = new Reminder();
     SelectData.SelectedDate = DateTime.Now;
     DataContext             = result;
 }
 public NewCommentWindow()
 {
     NormalizeWindiwSetting.Normalize(typeof(NewCommentWindow));
     InitializeComponent();
     comment          = new Comment();
     comment.Files    = new ObservableCollection <AdditionFile>();
     commentViewModel = new CommentViewModel(comment);
     DataContext      = commentViewModel;
 }
 public NewTaskWindows()
 {
     NormalizeWindiwSetting.Normalize(typeof(NewTaskWindows));
     InitializeComponent();
     WorkTask = new WorkTask()
     {
         Name     = "Новая задача",
         Text     = "Описание",
         Files    = new ObservableCollection <AdditionFile>(),
         Comments = new ObservableCollection <Comment>()
     };
     workTaskViewModel = new WorkTaskViewModel(WorkTask);
     DataContext       = workTaskViewModel;
 }
示例#5
0
 public AddFilesWindow(IEnumerable <AdditionFile> Files)
 {
     NormalizeWindiwSetting.Normalize(typeof(AddFilesWindow));
     InitializeComponent();
     DataContext = new AdditionalFilesViewModel(Files);
 }