File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System . Windows ;
22using System . Windows . Threading ;
3+ using Desktop . Project ;
34using Desktop . Tasks ;
45using Desktop . Tasks . Extensions ;
56using Microsoft . Extensions . Configuration ;
89namespace Desktop ;
910
1011/// <summary>
11- /// Interaction logic for App.xaml
12+ /// Interaction logic for App.xaml
1213/// </summary>
1314public partial class App : Application
1415{
@@ -24,6 +25,7 @@ protected override void OnStartup(StartupEventArgs e)
2425 services . AddSingleton < MainWindow > ( ) ;
2526 services . AddSingleton < TaskCreation > ( ) ;
2627 services . AddTransient < TaskCreationViewModel > ( ) ;
28+ services . AddTransient < TaskListViewModel > ( ) ;
2729 services . AddBackendTaskRepository ( Config ) ;
2830
2931 var serviceProvider = services . BuildServiceProvider ( ) ;
Original file line number Diff line number Diff line change @@ -8,20 +8,26 @@ public partial class MainWindow : Window
88{
99 private readonly ITaskRepository taskRepository ;
1010 private readonly TaskCreationViewModel taskCreationViewModel ;
11+ private readonly TaskListViewModel taskListViewModel ;
1112
1213 public MainWindow (
1314 ITaskRepository taskRepository ,
14- TaskCreationViewModel taskCreationViewModel )
15+ TaskCreationViewModel taskCreationViewModel ,
16+ TaskListViewModel taskListViewModel )
1517 {
1618 this . taskRepository = taskRepository ;
1719 this . taskCreationViewModel = taskCreationViewModel ;
20+ this . taskListViewModel = taskListViewModel ;
1821 InitializeComponent ( ) ;
1922 NavigateToTaskList ( ) ;
2023 }
2124
2225 private void NavigateToTaskList ( )
2326 {
24- var tasksList = new TasksList ( taskRepository , taskCreationViewModel ) ;
27+ var tasksList = new TasksList (
28+ taskRepository ,
29+ taskListViewModel ,
30+ taskCreationViewModel ) ;
2531 Content . Content = tasksList ;
2632 }
2733
Original file line number Diff line number Diff line change 1+ using Desktop . Common ;
2+
3+ namespace Desktop . Project ;
4+
5+ public class TaskListViewModel : ViewModelBase
6+ {
7+ public TaskListViewModel ( )
8+ {
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -12,14 +12,17 @@ namespace Desktop.Project;
1212public partial class TasksList : UserControl
1313{
1414 private readonly ITaskRepository taskRepository ;
15+ private readonly TaskListViewModel viewModel ;
1516 private readonly TaskCreationViewModel taskCreationViewModel ;
1617 private readonly ObservableCollection < Task > tasks = [ ] ;
1718
1819 public TasksList (
1920 ITaskRepository taskRepository ,
21+ TaskListViewModel viewModel ,
2022 TaskCreationViewModel taskCreationViewModel )
2123 {
2224 this . taskRepository = taskRepository ;
25+ this . viewModel = viewModel ;
2326 this . taskCreationViewModel = taskCreationViewModel ;
2427
2528 InitializeComponent ( ) ;
You can’t perform that action at this time.
0 commit comments