public MainWindow() { InitializeComponent(); InitializeUserControlViews(); _viewModel = new MainWindowViewModel(this, _taskListView, _taskDetailsView); DataContext = _viewModel; _notificationManager = new NotificationManager(_viewModel); _notificationManager.Start(); _viewModel.Search(); _saveService = new SaveService(_viewModel.Tasks); _saveService.Start(); _controlCycle = new List<Control> { _viewModel.UserControlViewList.ListBoxTasks, _viewModel.ViewDetails.ListBoxItems, _viewModel.ViewDetails.ListBoxLogs }; SetParentWindow(); }
public MainWindow() { InitializeComponent(); SetParentWindow(); Icon = new BitmapImage(new Uri(@"C:\Users\Shawn.Axsom\Desktop\TaskDash.ico")); LoadTrayIcon(); ShowTrayIcon(true); _tasks = new TaskViewModel(); _clipboardMonitor = new ClipboardMonitorService(); _clipboardMonitor.ClipboardData += new RoutedEventHandler(_clipboardMonitor_ClipboardData); listBoxTasks.DataContext = _tasks.FilteredTasks; comboBoxTagsFilter.DataContext = _tasks.Tasks.TagList; comboBoxSortBy.DataContext = TaskComparer.Instance; _notificationManager = new NotificationManager(_tasks); _notificationManager.Start(); _tasks.FilteredTasks.Filter += OnFilteredTasksFilter; Search(); _saveService = new SaveService(_tasks); _saveService.Start(); _controlCycle = new List<Control> { listBoxTasks, listBoxItems, listBoxLogs }; }