浏览代码

first commit

Гафиев Владислав Маратович 3 年之前
当前提交
f8b1835346
共有 51 个文件被更改,包括 2057 次插入0 次删除
  1. 25 0
      WpfApp29.sln
  2. 9 0
      WpfApp29/App.xaml
  3. 17 0
      WpfApp29/App.xaml.cs
  4. 24 0
      WpfApp29/AppHelper.cs
  5. 10 0
      WpfApp29/AssemblyInfo.cs
  6. 21 0
      WpfApp29/Filter.cs
  7. 29 0
      WpfApp29/MainContext.cs
  8. 40 0
      WpfApp29/MainWindow.xaml
  9. 32 0
      WpfApp29/MainWindow.xaml.cs
  10. 32 0
      WpfApp29/Models/StatusTask.cs
  11. 48 0
      WpfApp29/Models/Task.cs
  12. 44 0
      WpfApp29/Models/User.cs
  13. 58 0
      WpfApp29/Pages/AccountPage.xaml
  14. 31 0
      WpfApp29/Pages/AccountPage.xaml.cs
  15. 88 0
      WpfApp29/Pages/MainPage.xaml
  16. 33 0
      WpfApp29/Pages/MainPage.xaml.cs
  17. 27 0
      WpfApp29/Pages/UserListPage.xaml
  18. 31 0
      WpfApp29/Pages/UserListPage.xaml.cs
  19. 二进制
      WpfApp29/Pages/bg.png
  20. 86 0
      WpfApp29/RegistrationWindow.xaml
  21. 29 0
      WpfApp29/RegistrationWindow.xaml.cs
  22. 37 0
      WpfApp29/RelayCommand.cs
  23. 55 0
      WpfApp29/TaskCreationWindow.xaml
  24. 45 0
      WpfApp29/TaskCreationWindow.xaml.cs
  25. 16 0
      WpfApp29/UserControls/Base/TaskBaseUserControl.cs
  26. 60 0
      WpfApp29/UserControls/TaskCreatorUserControl.xaml
  27. 36 0
      WpfApp29/UserControls/TaskCreatorUserControl.xaml.cs
  28. 55 0
      WpfApp29/UserControls/TaskDeleteUserControl.xaml
  29. 35 0
      WpfApp29/UserControls/TaskDeleteUserControl.xaml.cs
  30. 62 0
      WpfApp29/UserControls/TaskDoerUserControl.xaml
  31. 37 0
      WpfApp29/UserControls/TaskDoerUserControl.xaml.cs
  32. 56 0
      WpfApp29/UserControls/TaskDoneUserControl.xaml
  33. 35 0
      WpfApp29/UserControls/TaskDoneUserControl.xaml.cs
  34. 51 0
      WpfApp29/UserControls/TaskEmptyUserControl.xaml
  35. 37 0
      WpfApp29/UserControls/TaskEmptyUserControl.xaml.cs
  36. 33 0
      WpfApp29/UserWindow.xaml
  37. 31 0
      WpfApp29/UserWindow.xaml.cs
  38. 17 0
      WpfApp29/ViewModels/AccountPageViewModel.cs
  39. 18 0
      WpfApp29/ViewModels/BaseTaskUserControlViewModel.cs
  40. 19 0
      WpfApp29/ViewModels/BaseViewModel.cs
  41. 136 0
      WpfApp29/ViewModels/MainPageViewModel.cs
  42. 63 0
      WpfApp29/ViewModels/MainWindowViewModel.cs
  43. 67 0
      WpfApp29/ViewModels/RegistrationWindowViewModel.cs
  44. 43 0
      WpfApp29/ViewModels/TaskCreatorUserControlViewModel.cs
  45. 42 0
      WpfApp29/ViewModels/TaskDoerUserControlViewModel.cs
  46. 30 0
      WpfApp29/ViewModels/TaskEmptyUserControlViewModel.cs
  47. 17 0
      WpfApp29/ViewModels/UserListPageViewModel.cs
  48. 110 0
      WpfApp29/ViewModels/UserWindowViewModel.cs
  49. 26 0
      WpfApp29/WpfApp29.csproj
  50. 74 0
      WpfApp29/WpfApp29.csproj.user
  51. 二进制
      WpfApp29/bg.png

+ 25 - 0
WpfApp29.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.32126.317
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApp29", "WpfApp29\WpfApp29.csproj", "{0F61592E-3D92-4EE6-8413-8FBAF32E7E98}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{0F61592E-3D92-4EE6-8413-8FBAF32E7E98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0F61592E-3D92-4EE6-8413-8FBAF32E7E98}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0F61592E-3D92-4EE6-8413-8FBAF32E7E98}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0F61592E-3D92-4EE6-8413-8FBAF32E7E98}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {29527258-2175-485D-BDA8-38C390D60804}
+	EndGlobalSection
+EndGlobal

+ 9 - 0
WpfApp29/App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="WpfApp29.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:WpfApp29"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 17 - 0
WpfApp29/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace WpfApp29
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 24 - 0
WpfApp29/AppHelper.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace WpfApp29
+{
+    public class AppHelper
+    {
+        public static T? GetWindowAtType<T>() where T: Window
+        {
+            foreach (var unknownWindoew in App.Current.Windows)
+            {
+                if (unknownWindoew is T window)
+                {
+                    return window;
+                }
+            }
+            return null;
+        }
+    }
+}

+ 10 - 0
WpfApp29/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+                                     //(used if a resource is not found in the page,
+                                     // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+                                              //(used if a resource is not found in the page,
+                                              // app, or any theme specific resource dictionaries)
+)]

+ 21 - 0
WpfApp29/Filter.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WpfApp29
+{
+    internal class Filter
+    {
+        public bool WhereTaskAccess { get; set; } = true;
+        public bool DateUp { get; set; } = true;
+        public bool DateDown { get; set; } = true;
+        public bool WhereTaskDone { get; set; }  = true;
+        public bool WhereTaskDelete { get; set; } = true;
+        public bool WhereTaskDoing { get; set; } = true;
+        public bool WhereTaskCreator { get; set; } = true;
+        public bool WhereTaskSomeone { get; set; } = true;
+        public bool WhereTaskUserLogin { get; set; } = true;
+    }
+}

+ 29 - 0
WpfApp29/MainContext.cs

@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore;
+using WpfApp29.Models;
+
+namespace WpfApp29
+{
+    internal class MainContext : DbContext
+    {
+        public MainContext() : base()
+        {
+            //Database.EnsureDeleted();
+            Database.EnsureCreated();
+        }
+        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        {
+            optionsBuilder.UseLazyLoadingProxies();
+            optionsBuilder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=WpfApp29;Trusted_Connection=True;");
+        }
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            modelBuilder.Entity<Models.Task>().HasOne(x => x.UserCreator).WithMany(t => t.TaskCreators).HasForeignKey(x => x.UserCreatorId).OnDelete(DeleteBehavior.Restrict);
+            modelBuilder.Entity<Models.Task>().HasOne(x => x.UserDoer).WithMany(t => t.TaskDoers).HasForeignKey(x => x.UserDoerId).OnDelete(DeleteBehavior.Restrict);
+            modelBuilder.Entity<Models.Task>().HasOne(x => x.Status).WithMany(t => t.Tasks).HasForeignKey(x => x.StatusId).OnDelete(DeleteBehavior.Restrict);
+        }
+
+        public DbSet<User> Users { get; set; }
+        public DbSet<Models.Task> Tasks { get; set; }
+        public DbSet<StatusTask> StatusTasks { get; set; }
+    }
+}

+ 40 - 0
WpfApp29/MainWindow.xaml

@@ -0,0 +1,40 @@
+<Window x:Class="WpfApp29.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:WpfApp29"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="450" Width="800">
+    <Grid>
+        <Grid.Background>
+            <ImageBrush ImageSource="/bg.png" Stretch="UniformToFill"/>
+        </Grid.Background>
+
+        <Border Padding="50" VerticalAlignment="Center" HorizontalAlignment="Center" Background="#E5ECCC74" BorderThickness="6" CornerRadius="30" BorderBrush="#FF312B04" Height="307" Grid.RowSpan="2">
+            <Grid>
+
+                <!--Надпись "Вход в личный кабинет"-->
+                <Label Content="Вход в личный кабинет" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, -200, 0, 0" FontSize="24" FontFamily="Copperplate Gothic Bold"></Label>
+
+                <!--Поле для ввода логина-->
+                <Label Content="Логин" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="15, -100, 300, 0"></Label>
+                <TextBox Name="TbLogin" Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="15, -100, 0, 0"
+                         Text="{Binding User.Login}"></TextBox>
+
+                <!--Поле для ввода пароля-->
+                <Label Content="Пароль" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="15, 25, 300, 0"></Label>
+                <PasswordBox Name="TbPassword"  Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="15, 25, 0, 0"></PasswordBox>
+
+                <!--Кнопка для входа в свой профиль-->
+                <Button Width="150" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Margin="-180, 150, 0, 0" Content="Зарегистрироваться" BorderBrush="#FF5A5205" 
+                        Command="{Binding CommandGoRegister}"></Button>
+                <Button Width="150" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Margin="180, 150, 0, 0" Content="Войти" BorderBrush="#FF5A5205"  
+                        Command="{Binding CommandLogin}" CommandParameter="{Binding ElementName=TbPassword}"></Button>
+
+            </Grid>
+        </Border>
+    </Grid>
+</Window>

+ 32 - 0
WpfApp29/MainWindow.xaml.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+
+[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
+namespace WpfApp29
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+            DataContext = new ViewModels.MainWindowViewModel();
+        }
+    }
+}

+ 32 - 0
WpfApp29/Models/StatusTask.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WpfApp29.Models
+{
+    public class StatusTask
+    {
+        public StatusTask()
+        {
+
+        }
+        public StatusTask(string name)
+        {
+            Id = 0;
+            Name = name;
+        }
+
+        // FOREIGN KEY
+        [Key]
+        public int Id { get; set; }
+
+        // MAIN FIELDS
+        public string Name { get; set; }
+
+        // PERVIOUS OBJECTS
+        public virtual List<Task> Tasks { get; set; } = new List<Task>();
+    }
+}

+ 48 - 0
WpfApp29/Models/Task.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations;
+
+namespace WpfApp29.Models
+{
+    public class Task
+    {
+        public Task()
+        {
+
+        }
+        public Task(string name, string desc, DateTime date, int userCreatorId, int userDoerId, int statusId)
+        {
+            Id = 0;
+            Name = name;
+            Desc = desc;
+            Date = date;
+            UserCreatorId = userCreatorId;
+            UserDoerId = userDoerId;
+            StatusId = statusId;
+        }
+
+        // FOREIGN KEY
+        [Key]
+        public int Id { get; set; }
+
+        // MAIN FIELDS
+        public string Name { get; set; }
+        public string Desc { get; set; }
+        public DateTime Date { get; set; }
+
+        // PERVIOUS KEYS
+        public int UserCreatorId { get; set; }
+        public int UserDoerId { get; set; }
+        public int StatusId { get; set; }
+
+        // PERVIOUS OBJECTS
+        public virtual User? UserCreator { get; set; }
+
+        public virtual User? UserDoer { get; set; }
+
+        public virtual StatusTask? Status { get; set; }
+    }
+}

+ 44 - 0
WpfApp29/Models/User.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WpfApp29.Models
+{
+    public class User
+    {
+        public User()
+        {
+
+        }
+        public User(string name, string familiya, string otchestvo, string login, string password, string phone)
+        {
+            Id = 0;
+            Name = name;
+            Familiya = familiya;
+            Otchestvo = otchestvo;
+            Login = login;
+            Password = password;
+            Phone = phone;
+        }
+
+        // FOREIGN KEY
+        [Key]
+        public int Id { get; set; }
+
+        // MAIN FIELDS
+        public string Name { get; set; }
+        public string Familiya { get; set; }
+        public string Otchestvo { get; set; }
+        public string Login { get; set; }
+        public string Password { get; set; }
+        public string Phone { get; set; }
+
+        // PERVIOUS OBJECTS
+        public virtual List<Task> TaskCreators { get; set; } = new List<Task> { };
+        public virtual List<Task> TaskDoers { get; set; } = new List<Task> { };
+        public static User CurrentUser { get; set; } = null!;
+    }
+}

+ 58 - 0
WpfApp29/Pages/AccountPage.xaml

@@ -0,0 +1,58 @@
+<Page x:Class="WpfApp29.Pages.AccountPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+      xmlns:uc="clr-namespace:WpfApp29.UserControls"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="AccountPage">
+    <Grid>
+        <Border Grid.Row="1" Padding="20" VerticalAlignment="Center" HorizontalAlignment="Center" Background="#E5ECCC74" BorderThickness="6" CornerRadius="30" BorderBrush="#FF312B04" Height="307" Grid.RowSpan="2">
+            <Grid>
+
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="150"></ColumnDefinition>
+                    <ColumnDefinition></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="60"></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                </Grid.RowDefinitions>
+
+                <TextBlock Text="Информация о вашем аккаунте" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Grid.ColumnSpan="2"></TextBlock>
+
+                <TextBlock Text="ФИО" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+
+                <TextBlock Text="Логин" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+
+                <TextBlock Text="Номер телефона" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+
+                <Grid Grid.Row="1" Grid.Column="1">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition></ColumnDefinition>
+                        <ColumnDefinition></ColumnDefinition>
+                        <ColumnDefinition></ColumnDefinition>
+                    </Grid.ColumnDefinitions>
+                    <TextBlock Name="TbSecondName"  Grid.Column="0"
+                               VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"
+                               Text="{Binding User.Familiya}"></TextBlock>
+                    <TextBlock Name="TbFirstName" Text="{Binding User.Name}"  Grid.Column="1" 
+                               VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+                    <TextBlock Name="TbMiddleName" Text="{Binding User.Otchestvo}" Grid.Column="2" 
+                               VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" ></TextBlock>
+                </Grid>
+
+                <TextBlock Name="TbLogin" Text="{Binding User.Login}" Grid.Row="2" Grid.Column="1" 
+                           VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+
+                <TextBlock Name="TbPhone" Text="{Binding User.Phone}" Grid.Row="3" Grid.Column="1" 
+                           VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"></TextBlock>
+
+            </Grid>
+        </Border>
+
+    </Grid>
+</Page>

+ 31 - 0
WpfApp29/Pages/AccountPage.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+using WpfApp29.UserControls;
+
+namespace WpfApp29.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для AccountPage.xaml
+    /// </summary>
+    public partial class AccountPage : Page
+    {
+        public AccountPage()
+        {
+            InitializeComponent();
+            DataContext = new ViewModels.AccountPageViewModel();
+        }
+    }
+}

+ 88 - 0
WpfApp29/Pages/MainPage.xaml

@@ -0,0 +1,88 @@
+<Page x:Class="WpfApp29.Pages.MainPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:WpfApp29.Pages" 
+      xmlns:uc="clr-namespace:WpfApp29.UserControls"
+      xmlns:viewmodels="clr-namespace:WpfApp29.ViewModels" 
+      d:DataContext="{d:DesignInstance Type=viewmodels:MainPageViewModel}"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="MainPage">
+    <Grid>
+        <Border BorderThickness="4" Grid.Row="1" Background="#E5E4D6B1" Padding="10" BorderBrush="Black" CornerRadius="5" Width="775" Margin="0, 0, 0, 8" >
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="517"></ColumnDefinition>
+                    <ColumnDefinition></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Grid.RowDefinitions>
+                    <RowDefinition ></RowDefinition>
+                </Grid.RowDefinitions>
+
+                <ScrollViewer Name="ScrollViewerOfTasks" Grid.Row="1">
+                    <WrapPanel Name="WpTasks">
+                        
+                    </WrapPanel>
+                </ScrollViewer>
+
+
+                <Grid Grid.Column="1" Grid.Row="1">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="20"></RowDefinition>
+                        <RowDefinition Height="40"></RowDefinition>
+                        <RowDefinition Height="40"></RowDefinition>
+                        <RowDefinition Height="160"></RowDefinition>
+                        <RowDefinition></RowDefinition>
+                    </Grid.RowDefinitions>
+
+                    <CheckBox Name="CbWhereTaskAccess" Content="Показывать доступные" FontSize="14" Grid.Row="0" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskAccess}" ></CheckBox>
+
+                    <RadioButton GroupName="RbDateFilter" Name="RbDateUp" Content="Дате публикации (возр.)" FontSize="14" Grid.Row="1" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.DateUp}" ></RadioButton>
+
+                    <RadioButton GroupName="RbDateFilter" Name="RbDateDown" Content="Дате публикации (убыв.)" FontSize="14" Grid.Row="2" 
+                         VerticalAlignment="Center"  IsChecked="{Binding Filter.DateDown}" ></RadioButton>
+
+
+                    <CheckBox Name="CbWhereTaskDone" Content="Показывать выполненные" FontSize="14" Grid.Row="3" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskDone}" ></CheckBox>
+
+                    <CheckBox Name="CbWhereTaskDelete" Content="Показывать удалённые" FontSize="14" Grid.Row="4" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskDelete}" ></CheckBox>
+
+                    <CheckBox Name="CbWhereTaskDoing" Content="Показывать выполняющиеся" FontSize="14" Grid.Row="5" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskDoing}" ></CheckBox>
+
+                    <CheckBox Name="CbWhereTaskCreator" Content="Показывать созданные мной" FontSize="14" Grid.Row="6" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskCreator}" ></CheckBox>
+
+                    <CheckBox Name="CbWhereTaskSomeone" Content="Показывать созданные не мной" FontSize="14" Grid.Row="7" 
+                         VerticalAlignment="Center" IsChecked="{Binding Filter.WhereTaskSomeone}" ></CheckBox>
+
+                    <CheckBox Name="CbWhereTaskUserLogin" Content="По логину пользователя" FontSize="14" Grid.Row="8" 
+                         VerticalAlignment="Bottom" IsChecked="{Binding Filter.WhereTaskUserLogin}"></CheckBox>
+
+                    <TextBox Name="TbUserLogin" Grid.Row="9" Height="30" Margin="5, 0, 5, 0" Text="{Binding UserLoginString}"></TextBox>
+
+                    <Line Stroke="Black" StrokeThickness="1" X1="5" Y1="0" X2="286" Y2="0" Grid.Row="10"></Line>
+
+
+                    <StackPanel Grid.Row="10">
+                        <Button Name="ButtonAddNewTask" Content="Добавть задание" Margin="5, 5, 5, 5" Command="{Binding CommandAddTask}" Height="40"></Button>
+                    </StackPanel>
+                </Grid>
+
+            </Grid>
+        </Border>
+    </Grid>
+</Page>

+ 33 - 0
WpfApp29/Pages/MainPage.xaml.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+using WpfApp29.UserControls;
+using WpfApp29.UserControls.Base;
+using WpfApp29.ViewModels;
+
+namespace WpfApp29.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для MainPage.xaml
+    /// </summary>
+    public partial class MainPage : Page
+    {
+        public MainPage()
+        {
+            InitializeComponent();
+            DataContext = new MainPageViewModel();
+        }
+    }
+}

+ 27 - 0
WpfApp29/Pages/UserListPage.xaml

@@ -0,0 +1,27 @@
+<Page x:Class="WpfApp29.Pages.UserListPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:WpfApp29.Pages" xmlns:uc="clr-namespace:WpfApp29.UserControls"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="UserListPage">
+    <Grid>
+        <Border Grid.Row="1" Padding="50" VerticalAlignment="Center" HorizontalAlignment="Center" 
+                Background="#E5ECCC74" BorderThickness="6" CornerRadius="30" BorderBrush="#FF312B04" Height="307" Grid.RowSpan="2">
+            <ScrollViewer>
+                <DataGrid AutoGenerateColumns="False" CanUserResizeColumns="True" ItemsSource="{Binding Users}" FontSize="25">
+                    <DataGrid.Columns>
+                        <DataGridTextColumn Header="ID" Binding="{Binding Id}"/>
+                        <DataGridTextColumn Header="Логин" Binding="{Binding Login}"/>
+                        <DataGridTextColumn Header="Фамилия" Binding="{Binding Familiya}"/>
+                        <DataGridTextColumn Header="Имя" Binding="{Binding Name}"/>
+                        <DataGridTextColumn Header="Отчество" Binding="{Binding Otchestvo}"/>
+                        <DataGridTextColumn Header="Номер телефона" Binding="{Binding Phone}"/>
+                    </DataGrid.Columns>
+                </DataGrid>
+            </ScrollViewer>
+        </Border>
+    </Grid>
+</Page>

+ 31 - 0
WpfApp29/Pages/UserListPage.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+using WpfApp29.UserControls;
+
+namespace WpfApp29.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для UserListPage.xaml
+    /// </summary>
+    public partial class UserListPage : Page
+    {
+        public UserListPage()
+        {
+            InitializeComponent();
+            DataContext = new ViewModels.UserListPageViewModel();
+        }
+    }
+}

二进制
WpfApp29/Pages/bg.png


+ 86 - 0
WpfApp29/RegistrationWindow.xaml

@@ -0,0 +1,86 @@
+<Window x:Class="WpfApp29.RegistrationWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:WpfApp29"
+        mc:Ignorable="d"
+        Title="RegistrationWindow" Height="600" Width="800">
+    <Grid>
+        <Grid.Background>
+            <ImageBrush ImageSource="/bg.png" Stretch="UniformToFill"/>
+        </Grid.Background>
+
+
+        <Border Padding="20" VerticalAlignment="Center" HorizontalAlignment="Center" Background="#E5ECCC74"
+                BorderThickness="6" CornerRadius="30" BorderBrush="#FF312B04" Height="480" Grid.RowSpan="2">
+            <Grid>
+
+                <Grid.RowDefinitions>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                </Grid.RowDefinitions>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="130"></ColumnDefinition>
+                    <ColumnDefinition></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                
+                <!--Надпись "Вход в личный кабинет"-->
+                <Label Content="Регистрация аккаунта" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontFamily="Copperplate Gothic Bold" Grid.ColumnSpan="2"></Label>
+
+                <!--Поле для ввода логина-->
+                <Label Content="Логин" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="0"></Label>
+                <TextBox Name="TbLogin" Width="200" Height="40" HorizontalAlignment="Center" 
+                         VerticalAlignment="Center" Grid.Row="1" Grid.Column="1"
+                         Text="{Binding User.Login}"></TextBox>
+
+                <!--Поле для ввода пароля-->
+                <Label Content="Пароль" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                       Grid.Row="2" Grid.Column="0"></Label>
+                <TextBox Name="TbPassword"  Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center"
+                             Grid.Row="2" Grid.Column="1" Text="{Binding User.Password}"></TextBox>
+
+                <!--Поле для ввода Фамилии-->
+                <Label Content="Фамилия" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="3" Grid.Column="0"></Label>
+                <TextBox Name="TbSecondName" Width="200" Height="40" HorizontalAlignment="Center" 
+                         VerticalAlignment="Center" Grid.Row="3" Grid.Column="1"
+                         Text="{Binding User.Familiya}"></TextBox>
+
+                <!--Поле для ввода Имени-->
+                <Label Content="Имя" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="4" Grid.Column="0"></Label>
+                <TextBox Name="TbFirstName" Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                         Grid.Row="4" Grid.Column="1"
+                          Text="{Binding User.Name}"></TextBox>
+
+                <!--Поле для ввода Отчества-->
+                <Label Content="Отчество" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="5" Grid.Column="0"></Label>
+                <TextBox Name="TbMiddleName" Width="200" Height="40" HorizontalAlignment="Center" 
+                         VerticalAlignment="Center" Grid.Row="5" Grid.Column="1"
+                          Text="{Binding User.Otchestvo}"></TextBox>
+
+                <!--Поле для ввода Номера Телефона-->
+                <Label Content="Номер телефона" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="6" Grid.Column="0"></Label>
+                <TextBox Name="TbPhoneNumber" Width="200" Height="40" HorizontalAlignment="Center"
+                         VerticalAlignment="Center" Grid.Row="6" Grid.Column="1"
+                         Text="{Binding User.Phone}"></TextBox>
+
+                <!--Кнопка регистрации-->
+                <Button Width="220" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Content="Зарегистрироваться" BorderBrush="#FF5A5205" 
+                        Grid.Row="7" Grid.Column="1"  Command="{Binding CommandRegister}"></Button>
+
+                <!--Кнопка отмены регистрации-->
+                <Button Width="110" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Content="Отмена" BorderBrush="#FF5A5205" 
+                        Grid.Row="7" Grid.Column="0" Command="{Binding CommandGoLogin}"></Button>
+
+            </Grid>
+        </Border>
+    </Grid>
+</Window>

+ 29 - 0
WpfApp29/RegistrationWindow.xaml.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+
+namespace WpfApp29
+{
+    /// <summary>
+    /// Логика взаимодействия для RegistrationWindow.xaml
+    /// </summary>
+    public partial class RegistrationWindow : Window
+    {
+        public RegistrationWindow()
+        {
+            InitializeComponent();
+            DataContext = new ViewModels.RegistrationWindowViewModel();
+        }
+    }
+}

+ 37 - 0
WpfApp29/RelayCommand.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace WpfApp29
+{
+    internal class RelayCommand : ICommand
+    {
+        private Action<object> execute;
+        private Func<object, bool> canExecute;
+
+        public event EventHandler CanExecuteChanged
+        {
+            add { CommandManager.RequerySuggested += value; }
+            remove { CommandManager.RequerySuggested -= value; }
+        }
+
+        public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
+        {
+            this.execute = execute;
+            this.canExecute = canExecute;
+        }
+
+        public bool CanExecute(object parameter)
+        {
+            return this.canExecute == null || this.canExecute(parameter);
+        }
+
+        public void Execute(object parameter)
+        {
+            this.execute(parameter);
+        }
+    }
+}

+ 55 - 0
WpfApp29/TaskCreationWindow.xaml

@@ -0,0 +1,55 @@
+<Window x:Class="WpfApp29.TaskCreationWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:WpfApp29"
+        mc:Ignorable="d"
+        Title="TaskCreationWindow" Height="450" Width="800">
+    <Window.Background>
+        <ImageBrush ImageSource="/bg.png"/>
+    </Window.Background>
+    <Grid>
+        <Border Padding="20" VerticalAlignment="Center" HorizontalAlignment="Center" Background="#E5ECCC74"
+                BorderThickness="6" CornerRadius="30" BorderBrush="#FF312B04" Height="300" Grid.RowSpan="2">
+            <Grid>
+
+                <Grid.RowDefinitions>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                    <RowDefinition></RowDefinition>
+                </Grid.RowDefinitions>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="130"></ColumnDefinition>
+                    <ColumnDefinition></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+
+                <!--Надпись "Вход в личный кабинет"-->
+                <Label Content="Добавление нового задания" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" 
+                       FontFamily="Copperplate Gothic Bold" Grid.ColumnSpan="2"></Label>
+
+                <!--Поле для ввода названия задания-->
+                <Label Content="Название задания" HorizontalAlignment="Center" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="0"></Label>
+                <TextBox Name="TbTaskName" Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1"></TextBox>
+
+                <!--Поле для ввода описания задания-->
+                <Label Content="Описание задания" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Grid.Column="0"></Label>
+                <TextBox Name="TbTaskDesc"  Width="200" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center"
+                             Grid.Row="2" Grid.Column="1"></TextBox>
+
+                <!--Кнопка добавления задания-->
+                <Button Name="ButtonAddNewTask" Width="220" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Content="Добавить задание" BorderBrush="#FF5A5205" 
+                        Grid.Row="4" Grid.Column="1" Click="ButtonAddNewTask_Click"></Button>
+
+                <!--Кнопка отмены добавления задания-->
+                <Button Name="ButtonGoBack"  Width="110" Height="40" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                        Content="Отмена" BorderBrush="#FF5A5205" 
+                        Grid.Row="4" Grid.Column="0" Click="ButtonGoBack_Click"></Button>
+
+            </Grid>
+        </Border>
+
+    </Grid>
+</Window>

+ 45 - 0
WpfApp29/TaskCreationWindow.xaml.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+
+namespace WpfApp29
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskCreationWindow.xaml
+    /// </summary>
+    public partial class TaskCreationWindow : Window
+    {
+        public TaskCreationWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void ButtonGoBack_Click(object sender, RoutedEventArgs e)
+        {
+            CloseThisWindow();
+        }
+
+        private void ButtonAddNewTask_Click(object sender, RoutedEventArgs e)
+        {
+            MainContext ctx = new MainContext();
+            ctx.Tasks.Add(new Models.Task(TbTaskName.Text, TbTaskDesc.Text, DateTime.Now, User.CurrentUser.Id, User.CurrentUser.Id, 1));
+            ctx.SaveChanges();
+            CloseThisWindow();
+        }
+        private void CloseThisWindow()
+        {
+            this.Close();
+        }
+    }
+}

+ 16 - 0
WpfApp29/UserControls/Base/TaskBaseUserControl.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace WpfApp29.UserControls.Base
+{
+    public interface ITaskUserControl
+    {
+        public abstract void HasTask(Task task);
+    }
+}

+ 60 - 0
WpfApp29/UserControls/TaskCreatorUserControl.xaml

@@ -0,0 +1,60 @@
+<UserControl x:Class="WpfApp29.UserControls.TaskCreatorUserControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:WpfApp29.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="200" d:DesignWidth="500" Width="500" Height="200" 
+             BorderThickness="2, 1, 2, 1" BorderBrush="Black" VerticalAlignment="Top">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="3*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="1.25*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <TextBlock Name="TbTaskName" Text="{Binding Task.Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25" Grid.ColumnSpan="2">N</TextBlock>
+        <Button Content="???" Grid.ColumnSpan="2" Width="20" Height="20" HorizontalAlignment="Right" Margin="0, 0, 5, 0">
+            <Button.ToolTip>
+                <ToolTip Background="Wheat">
+                    <StackPanel>
+                        <TextBlock Name="TbTaskDesc" Text="{Binding Task.Desc}"></TextBlock>
+                    </StackPanel>
+                </ToolTip>
+            </Button.ToolTip>
+        </Button>
+
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="1" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="2" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="3" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="0" X2="125" Y2="120" Grid.Row="1" Grid.RowSpan="3"></Line>
+
+        <TextBlock Grid.Row="1" Text="Дата" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskDate"  Grid.Column="1" Grid.Row="1" Text="{Binding Task.Date}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="2" Text="Создатель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Grid.Column="1" Grid.Row="2" Text="Создателем являетесь Вы" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="3" Text="Исполнитель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, 0, -5, 0"></TextBlock>
+        <TextBlock Name = "TbTaskDoerLogin" Grid.Column="1" Grid.Row="3" Text="{Binding Task.UserDoer.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <Grid  Grid.Row="4" Grid.ColumnSpan="2">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            
+            <Button Name="ButtonDeleteTask" Grid.Column="0" Width="200" Content="Удалить задание" Margin="0, 5, 0, 5" Command="{Binding CommandRemoveTask}"></Button>
+            <Button Name="ButtonSetDone" Grid.Column="1" Width="200" Content="Пометить готовым" Margin="0, 5, 0, 5" Command="{Binding CommandSetDoneTask}"></Button>
+        </Grid>
+        
+    </Grid>
+</UserControl>

+ 36 - 0
WpfApp29/UserControls/TaskCreatorUserControl.xaml.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Pages;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.UserControls
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskCreatorUserControl.xaml
+    /// </summary>
+    public partial class TaskCreatorUserControl : UserControl, ITaskUserControl
+    {
+
+        public TaskCreatorUserControl()
+        {
+            InitializeComponent();
+            Background = new SolidColorBrush(Colors.LightBlue);
+        }
+        public void HasTask(Task task)
+        {
+            DataContext = new ViewModels.TaskCreatorUserControlViewModel(task);
+        }
+    }
+}

+ 55 - 0
WpfApp29/UserControls/TaskDeleteUserControl.xaml

@@ -0,0 +1,55 @@
+<UserControl x:Class="WpfApp29.UserControls.TaskDeleteUserControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:WpfApp29.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="200" d:DesignWidth="500" Width="500" Height="200" 
+             BorderThickness="2, 1, 2, 1" BorderBrush="Black" VerticalAlignment="Top">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="3*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="1.25*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <TextBlock Name="TbTaskName"  Text="{Binding Task.Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25" Grid.ColumnSpan="2"></TextBlock>
+        <Button Content="???" Grid.ColumnSpan="2" Width="20" Height="20" HorizontalAlignment="Right" Margin="0, 0, 5, 0">
+            <Button.ToolTip>
+                <ToolTip Background="Wheat">
+                    <StackPanel>
+                        <TextBlock Name="TbTaskDesc">Всем привет, я подсказка!</TextBlock>
+                    </StackPanel>
+                </ToolTip>
+            </Button.ToolTip>
+        </Button>
+
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="1" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="2" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="3" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="0" X2="125" Y2="120" Grid.Row="1" Grid.RowSpan="3"></Line>
+
+        <TextBlock Grid.Row="1" Text="Дата" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskDate"  Grid.Column="1" Grid.Row="1" Text="{Binding Task.Date}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="2" Text="Создатель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskCreatorLogin"  Grid.Column="1" Grid.Row="2" Text="{Binding Task.UserCreator.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="3" Text="Исполнитель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, 0, -5, 0"></TextBlock>
+        <TextBlock Name="TbTaskDoerLogin" Grid.Column="1" Grid.Row="3" Text="{Binding Task.UserDoer.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Name="ButtonDeleteTask" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="4" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center">
+            Это задание было удалено вами и 
+            <LineBreak />
+            сохранено в вашей истории задач
+        </TextBlock>
+    </Grid>
+</UserControl>

+ 35 - 0
WpfApp29/UserControls/TaskDeleteUserControl.xaml.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.UserControls
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskDeleteUserControl.xaml
+    /// </summary>
+    public partial class TaskDeleteUserControl : UserControl, ITaskUserControl
+    {
+        public TaskDeleteUserControl()
+        {
+            InitializeComponent();
+            Background = new SolidColorBrush(Colors.DarkRed);
+        }
+
+        public void HasTask(Models.Task task)
+        {
+            DataContext = new ViewModels.BaseTaskUserControlViewModel(task);
+        }
+    }
+}

+ 62 - 0
WpfApp29/UserControls/TaskDoerUserControl.xaml

@@ -0,0 +1,62 @@
+<UserControl x:Class="WpfApp29.UserControls.TaskDoerUserControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:WpfApp29.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="200" d:DesignWidth="500" Width="500" Height="200" 
+             BorderThickness="2, 1, 2, 1" BorderBrush="Black" VerticalAlignment="Top">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="3*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="1.25*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <TextBlock Name="TbTaskName"  Text="{Binding Task.Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25" Grid.ColumnSpan="2"></TextBlock>
+        <Button Content="???" Grid.ColumnSpan="2" Width="20" Height="20" HorizontalAlignment="Right" Margin="0, 0, 5, 0">
+            <Button.ToolTip>
+                <ToolTip Background="Wheat">
+                    <StackPanel>
+                        <TextBlock Name="TbTaskDesc">Всем привет, я подсказка!</TextBlock>
+                    </StackPanel>
+                </ToolTip>
+            </Button.ToolTip>
+        </Button>
+
+
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="1" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="2" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="3" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="0" X2="125" Y2="120" Grid.Row="1" Grid.RowSpan="3"></Line>
+
+        <TextBlock Grid.Row="1" Text="Дата" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskDate" Grid.Column="1" Grid.Row="1" Text="{Binding Task.Date}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="2" Text="Создатель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskCreatorLogin" Grid.Column="1" Grid.Row="2" Text="{Binding Task.UserCreator.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="3" Text="Исполнитель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, 0, -5, 0"></TextBlock>
+        <TextBlock Grid.Column="1" Grid.Row="3" Text="Исполнителем задания являетесь вы" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <Grid  Grid.Row="4" Grid.ColumnSpan="2">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Name="ButtonSetDecline" Grid.Column="0" Width="200" Content="Отказаться от задания" Margin="0, 5, 0, 5" Command="{Binding CommandDeclineTask}"></Button>
+            <Button Name="ButtonSetDone" Grid.Column="1" Width="200" Content="Пометить готовым" Margin="0, 5, 0, 5" Command="{Binding CommandDoneTask}"></Button>
+        </Grid>
+
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="5" X2="125" Y2="115" Grid.Row="1" Grid.RowSpan="3"></Line>
+        
+    </Grid>
+</UserControl>

+ 37 - 0
WpfApp29/UserControls/TaskDoerUserControl.xaml.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+using WpfApp29.Pages;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.UserControls
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskDoerUserControl.xaml
+    /// </summary>
+    public partial class TaskDoerUserControl : UserControl, ITaskUserControl
+    {
+        public TaskDoerUserControl()
+        {
+            InitializeComponent();
+            Background = new SolidColorBrush(Colors.LightGreen);
+        }
+
+        public void HasTask(Models.Task task)
+        {
+            DataContext = new ViewModels.TaskDoerUserControlViewModel(task);
+        }
+    }
+}

+ 56 - 0
WpfApp29/UserControls/TaskDoneUserControl.xaml

@@ -0,0 +1,56 @@
+<UserControl x:Class="WpfApp29.UserControls.TaskDoneUserControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:WpfApp29.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="200" d:DesignWidth="500" Width="500" Height="200" 
+             BorderThickness="2, 1, 2, 1" BorderBrush="Black" VerticalAlignment="Top">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="3*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="1.25*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <TextBlock Name="TbTaskName"  Text="{Binding Task.Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25" Grid.ColumnSpan="2"></TextBlock>
+        <Button Content="???" Grid.ColumnSpan="2" Width="20" Height="20" HorizontalAlignment="Right" Margin="0, 0, 5, 0">
+            <Button.ToolTip>
+                <ToolTip Background="Wheat">
+                    <StackPanel>
+                        <TextBlock Name="TbTaskDesc">Всем привет, я подсказка!</TextBlock>
+                    </StackPanel>
+                </ToolTip>
+            </Button.ToolTip>
+        </Button>
+
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="1" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="2" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="3" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="0" X2="125" Y2="120" Grid.Row="1" Grid.RowSpan="3"></Line>
+
+        <TextBlock Grid.Row="1" Text="Дата" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskDate"  Grid.Column="1" Grid.Row="1" Text="{Binding Task.Date}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="2" Text="Создатель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskCreatorLogin"  Grid.Column="1" Grid.Row="2" Text="{Binding Task.UserCreator.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="3" Text="Исполнитель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, 0, -5, 0"></TextBlock>
+        <TextBlock Name="TbTaskDoerLogin" Grid.Column="1" Grid.Row="3" Text="{Binding Task.UserDoer.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Name="ButtonDeleteTask" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="4" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center">
+            Это задание было выполнено и 
+            <LineBreak />
+            сохранено в вашей истории задач
+        </TextBlock>
+
+    </Grid>
+</UserControl>

+ 35 - 0
WpfApp29/UserControls/TaskDoneUserControl.xaml.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.UserControls
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskDoneUserControl.xaml
+    /// </summary>
+    public partial class TaskDoneUserControl : UserControl, ITaskUserControl
+    {
+        public TaskDoneUserControl()
+        {
+            InitializeComponent();
+            Background = new SolidColorBrush(Colors.Green);
+        }
+
+        public void HasTask(Models.Task task)
+        {
+            DataContext = new ViewModels.BaseTaskUserControlViewModel(task);
+        }
+    }
+}

+ 51 - 0
WpfApp29/UserControls/TaskEmptyUserControl.xaml

@@ -0,0 +1,51 @@
+<UserControl x:Class="WpfApp29.UserControls.TaskEmptyUserControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:WpfApp29.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="200" d:DesignWidth="500" Width="500" Height="200" 
+             BorderThickness="2, 1, 2, 1" BorderBrush="Black" VerticalAlignment="Top">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="3*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="1.25*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <TextBlock Name="TbTaskName" Text="{Binding Task.Name}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25" Grid.ColumnSpan="2"></TextBlock>
+        <Button Content="???" Grid.ColumnSpan="2" Width="20" Height="20" HorizontalAlignment="Right" Margin="0, 0, 5, 0">
+            <Button.ToolTip>
+                <ToolTip Background="Wheat">
+                    <StackPanel>
+                        <TextBlock Name="TbTaskDesc">Всем привет, я подсказка!</TextBlock>
+                    </StackPanel>
+                </ToolTip>
+            </Button.ToolTip>
+        </Button>
+        
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="1" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="2" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="3" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="1" X1="15" Y1="0" X2="485" Y2="0" Grid.Row="4" Grid.ColumnSpan="2"></Line>
+        <Line Stroke="Black" StrokeThickness="3" X1="125" Y1="0" X2="125" Y2="120" Grid.Row="1" Grid.RowSpan="3"></Line>
+
+        <TextBlock Grid.Row="1" Text="Дата" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskDate" Grid.Column="1" Grid.Row="1" Text="{Binding Task.Date}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="2" Text="Создатель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+        <TextBlock Name="TbTaskCreatorLogin" Grid.Column="1" Grid.Row="2" Text="{Binding Task.UserCreator.Login}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <TextBlock Grid.Row="3" Text="Исполнитель" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0, 0, -5, 0"></TextBlock>
+        <TextBlock Grid.Column="1" Grid.Row="3" Text="Отсутствует, вы можете принять задание" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
+
+        <Button Name="ButtonAccept" Grid.Row="4" Grid.ColumnSpan="2" Width="200" Content="Принять" Margin="0, 5, 0, 5" FontSize="18" Command="{Binding CommandAcceptTask}"></Button>
+    </Grid>
+</UserControl>

+ 37 - 0
WpfApp29/UserControls/TaskEmptyUserControl.xaml.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Models;
+using WpfApp29.Pages;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.UserControls
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskEmptyUserControl.xaml
+    /// </summary>
+    public partial class TaskEmptyUserControl : UserControl, ITaskUserControl
+    {
+        public TaskEmptyUserControl()
+        {
+            InitializeComponent();
+            Background = new SolidColorBrush(Colors.LightYellow);
+        }
+
+        public void HasTask(Models.Task task)
+        {
+            DataContext = new ViewModels.TaskEmptyUserControlViewModel(task);
+        }
+    }
+}

+ 33 - 0
WpfApp29/UserWindow.xaml

@@ -0,0 +1,33 @@
+<Window x:Class="WpfApp29.UserWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:WpfApp29" xmlns:usercontrols="clr-namespace:WpfApp29.UserControls"
+        mc:Ignorable="d"
+        Title="UserWindow" Height="450" Width="800">
+    <Grid>
+        <Grid.Background>
+            <ImageBrush ImageSource="/bg.png"/>
+        </Grid.Background>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="80"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Border VerticalAlignment="Top" HorizontalAlignment="Center" Padding="7" BorderThickness="4" CornerRadius="10" BorderBrush="Black" Grid.RowSpan="2">
+            <Border.Background>
+                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+                    <GradientStop Color="#FF2D2727"/>
+                    <GradientStop Color="#FF7F1F1F" Offset="1"/>
+                </LinearGradientBrush>
+            </Border.Background>
+            <WrapPanel Height="50" HorizontalAlignment="Center">
+                <Button Content="Главное меню" Width="150" Height="50" FontSize="18" Command="{Binding CommandGoMainMenu}"></Button>
+                <Button Content="Мой аккаунт" Width="150" Height="50" FontSize="18" Command="{Binding CommandGoAccount}"></Button>
+                <Button Content="Пользователи" Width="150" Height="50" FontSize="18" Command="{Binding CommandGoUserList}"></Button>
+                <Button Content="Выйти" Width="150" Height="50" FontSize="18" Command="{Binding CommandGoLoginWindow}"></Button>
+            </WrapPanel>
+        </Border>
+        <Frame Name="FramePages" Grid.Row="2"></Frame>
+    </Grid>
+</Window>

+ 31 - 0
WpfApp29/UserWindow.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using WpfApp29.Pages;
+using WpfApp29.ViewModels;
+
+namespace WpfApp29
+{
+    /// <summary>
+    /// Логика взаимодействия для UserWindow.xaml
+    /// </summary>
+    public partial class UserWindow : Window
+    {
+        public UserWindow()
+        {
+            InitializeComponent();
+            DataContext = new UserWindowViewModel();
+        }
+    }
+}

+ 17 - 0
WpfApp29/ViewModels/AccountPageViewModel.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class AccountPageViewModel : BaseViewModel
+    {
+        public User User
+        {
+            get => User.CurrentUser;
+        }
+    }
+}

+ 18 - 0
WpfApp29/ViewModels/BaseTaskUserControlViewModel.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class BaseTaskUserControlViewModel : BaseViewModel
+    {
+        public Task Task { get; set; } = new Task();
+        public BaseTaskUserControlViewModel() { }
+        public BaseTaskUserControlViewModel(Task task) 
+        {
+            Task = task;
+        }
+    }
+}

+ 19 - 0
WpfApp29/ViewModels/BaseViewModel.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WpfApp29.ViewModels
+{
+    public class BaseViewModel : INotifyPropertyChanged
+    {
+        public event PropertyChangedEventHandler? PropertyChanged;
+        public void OnPropertyChanged([CallerMemberName] string property = "")
+        {
+            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
+        }
+    }
+}

+ 136 - 0
WpfApp29/ViewModels/MainPageViewModel.cs

@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using WpfApp29.Models;
+using WpfApp29.Pages;
+using WpfApp29.UserControls;
+using WpfApp29.UserControls.Base;
+
+namespace WpfApp29.ViewModels
+{
+    internal class MainPageViewModel : BaseViewModel
+    {
+        public MainPageViewModel()
+        {
+            UpadeRepeat();
+        }
+        public WrapPanel? WpTasks => (AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Content as MainPage)?.WpTasks;
+
+        
+        private Filter _filter = new Filter();
+        public Filter Filter
+        {
+            get
+            {
+                return _filter;
+            }
+            set
+            {
+                _filter = value;
+                OnPropertyChanged();
+            }
+        }
+
+        private string _userLoginString = "";
+        public string UserLoginString
+        {
+            get
+            {
+                return _userLoginString;
+            }
+            set
+            {
+                _userLoginString = value;
+                OnPropertyChanged();
+            }
+        }
+        public RelayCommand? _commandAddTask;
+        public RelayCommand CommandAddTask
+        {
+            get
+            {
+                return _commandAddTask ??= new RelayCommand(
+                x =>
+                {
+                    new TaskCreationWindow().Show();
+                });
+            }
+        }
+        public void UpdateWpTasks()
+        {
+            if (WpTasks == null) return;
+            WpTasks.Children.Clear();
+            MainContext ctx = new MainContext();
+            List<Models.Task> tasks = ctx.Tasks.ToList();
+
+            if (Filter.WhereTaskUserLogin)
+            {
+                tasks = tasks.Where(task => task.UserCreator?.Login.Contains(UserLoginString) ?? false).ToList();
+                tasks = tasks.OrderByDescending(task => task.UserCreator?.Equals(UserLoginString)).ToList();
+            }
+            if (Filter.DateUp)
+            {
+                tasks = tasks.OrderBy(task => task.Date).ToList();
+            }
+            else if (Filter.DateDown)
+            {
+                tasks = tasks.OrderByDescending(task => task.Date).ToList();
+            }
+
+            int row = 0;
+            tasks.ForEach(task =>
+            {
+                UIElement children;
+
+                if (task.StatusId == 4 && task.UserCreatorId == User.CurrentUser?.Id && Filter.WhereTaskDelete)
+                {
+                    children = new TaskDeleteUserControl();
+                }
+                else if (task.StatusId == 4)
+                {
+                    return;
+                }
+                else if (task.StatusId == 3 && Filter.WhereTaskDone && (task.UserCreatorId == User.CurrentUser?.Id || task.UserDoerId == User.CurrentUser?.Id || Filter.WhereTaskSomeone))
+                {
+                    children = new TaskDoneUserControl();
+                }
+                else if (task.UserDoerId == User.CurrentUser?.Id && task.StatusId == 2 && Filter.WhereTaskDoing)
+                {
+                    children = new TaskDoerUserControl();
+                }
+                else if (task.UserCreatorId == User.CurrentUser?.Id && Filter.WhereTaskCreator)
+                {
+                    children = new TaskCreatorUserControl();
+                }
+                else if (task.StatusId == 1 && Filter.WhereTaskAccess)
+                {
+                    children = new TaskEmptyUserControl();
+                }
+                else
+                {
+                    return;
+                }
+
+                (children as ITaskUserControl)?.HasTask(task);
+
+                Grid.SetRow(children, row);
+                WpTasks.Children.Add(children);
+
+                row++;
+            });
+        }
+        private async void UpadeRepeat()
+        {
+            while (true)
+            {
+                UpdateWpTasks();
+                OnPropertyChanged();
+                await System.Threading.Tasks.Task.Delay(200);
+            }
+        }
+    }
+}

+ 63 - 0
WpfApp29/ViewModels/MainWindowViewModel.cs

@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    internal class MainWindowViewModel : BaseViewModel
+    {
+        public User? _user;
+        public User User
+        {
+            get => _user ??= new User();
+            set
+            {
+                _user = value;
+                OnPropertyChanged();
+            }
+        }
+        public RelayCommand? _commandLogin;
+        public RelayCommand CommandLogin
+        {
+            get
+            {
+                return _commandLogin ??= new RelayCommand(
+                x =>
+                {
+                    User.Password = (x as PasswordBox)?.Password ?? "";
+                    MainContext ctx = new MainContext();
+                    User? user = ctx.Users.FirstOrDefault(u => u.Login == User.Login && u.Password == User.Password);
+                    if (user == null)
+                    {
+                        MessageBox.Show("Вы ввели неверные логин или пароль");
+                        return;
+                    }
+                    User.CurrentUser = user;
+                    new UserWindow().Show();
+                    AppHelper.GetWindowAtType<MainWindow>()?.Close();
+                }
+                );
+            }
+        }
+        public RelayCommand? _commandGoRegister;
+        public RelayCommand? CommandGoRegister
+        {
+            get
+            {
+                return _commandGoRegister ??= new RelayCommand(
+                x =>
+                {
+                    new RegistrationWindow().Show();
+                    AppHelper.GetWindowAtType<MainWindow>()?.Close();
+                }
+                );
+            }
+        }
+
+    }
+}

+ 67 - 0
WpfApp29/ViewModels/RegistrationWindowViewModel.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class RegistrationWindowViewModel : BaseViewModel
+    {
+        private User? _user;
+        public User User
+        {
+            get { return _user ??= new User(); }
+            set { _user = value; OnPropertyChanged(); }
+        }
+        public RelayCommand? _commandRegister;
+        public RelayCommand? CommandRegister
+        {
+            get
+            {
+                return _commandRegister ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    
+                    if (ctx.Users.Any(u => u.Login == User.Login))
+                    {
+                        MessageBox.Show("Такой логин уже занят");
+                        return;
+                    }
+
+                    if (ctx.Users.Any(u => u.Phone == User.Phone))
+                    {
+                        MessageBox.Show("Такой номер телефона уже занят");
+                        return;
+                    }
+
+                    ctx.Users.Add(User);
+                    ctx.SaveChanges();
+                    MainWindow mainWindow = new MainWindow();
+                    MessageBox.Show(mainWindow, "Вы успешно зарегистрировались");
+                    mainWindow.Show();
+                    AppHelper.GetWindowAtType<RegistrationWindow>()?.Close();
+                }
+                );
+            }
+        }
+
+        public RelayCommand? _commandGoLogin;
+        public RelayCommand? CommandGoLogin
+        {
+            get
+            {
+                return _commandGoLogin ??= new RelayCommand(
+                x =>
+                {
+                    new MainWindow().Show();
+                    AppHelper.GetWindowAtType<RegistrationWindow>()?.Close();
+                });
+            }
+        }
+
+    }
+}

+ 43 - 0
WpfApp29/ViewModels/TaskCreatorUserControlViewModel.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class TaskCreatorUserControlViewModel : BaseTaskUserControlViewModel
+    {
+        public TaskCreatorUserControlViewModel() { }
+        public TaskCreatorUserControlViewModel(Task task) : base(task) { }
+        public RelayCommand? _commandRemoveTask;
+        public RelayCommand? CommandRemoveTask
+        {
+            get
+            {
+                return _commandRemoveTask ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    var task = ctx.Tasks.First(t => Task.Id == t.Id);
+                    task.StatusId = 4;
+                    ctx.SaveChanges();
+                });
+            }
+        }
+        public RelayCommand? _commandSetDoneTask;
+        public RelayCommand? CommandSetDoneTask
+        {
+            get
+            {
+                return _commandSetDoneTask ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    ctx.Tasks.ToList().First(t => Task.Id == t.Id).StatusId = 3;
+                    ctx.SaveChanges();
+                });
+            }
+        }
+    }
+}

+ 42 - 0
WpfApp29/ViewModels/TaskDoerUserControlViewModel.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class TaskDoerUserControlViewModel : BaseTaskUserControlViewModel
+    {
+        public TaskDoerUserControlViewModel() { }
+        public TaskDoerUserControlViewModel(Task task) : base(task) { }
+        public RelayCommand? _commandDeclineTask;
+        public RelayCommand? CommandDeclineTask
+        {
+            get
+            {
+                return _commandDeclineTask ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    ctx.Tasks.ToList().First(t => Task.Id == t.Id).StatusId = 1;
+                    ctx.SaveChanges();
+                });
+            }
+        }
+        public RelayCommand? _commandDoneTask;
+        public RelayCommand? CommandDoneTask
+        {
+            get
+            {
+                return _commandDoneTask ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    ctx.Tasks.ToList().First(t => Task.Id == t.Id).StatusId = 3;
+                    ctx.SaveChanges();
+                });
+            }
+        }
+    }
+}

+ 30 - 0
WpfApp29/ViewModels/TaskEmptyUserControlViewModel.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class TaskEmptyUserControlViewModel : BaseTaskUserControlViewModel
+    {
+        public TaskEmptyUserControlViewModel() { }
+        public TaskEmptyUserControlViewModel(Task task) : base(task) { }
+        public RelayCommand? _commandAcceptTask;
+        public RelayCommand? CommandAcceptTask
+        {
+            get
+            {
+                return _commandAcceptTask ??= new RelayCommand(
+                x =>
+                {
+                    MainContext ctx = new MainContext();
+                    var task = ctx.Tasks.ToList().First(t => Task.Id == t.Id);
+                    task.StatusId = 2;
+                    task.UserDoerId = User.CurrentUser.Id;
+                    ctx.SaveChanges();
+                });
+            }
+        }
+    }
+}

+ 17 - 0
WpfApp29/ViewModels/UserListPageViewModel.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WpfApp29.Models;
+
+namespace WpfApp29.ViewModels
+{
+    class UserListPageViewModel : BaseViewModel
+    {
+        public List<User> Users
+        {
+            get => new MainContext().Users.ToList();
+        }
+    }
+}

+ 110 - 0
WpfApp29/ViewModels/UserWindowViewModel.cs

@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WpfApp29.Pages;
+
+namespace WpfApp29.ViewModels
+{
+    internal class UserWindowViewModel
+    {
+        public UserWindowViewModel()
+        {
+            AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Navigate(MainPage);
+        }
+        private MainPage? _mainPage;
+        private AccountPage? _accountPage;
+        private UserListPage? _userListPage;
+        public MainPage MainPage
+        {
+            get => _mainPage ??= new MainPage();
+        }
+        public AccountPage AccountPage
+        {
+            get => _accountPage ??= new AccountPage();
+        }
+        public UserListPage UserListPage
+        {
+            get => _userListPage ??= new UserListPage();
+        }
+
+        public RelayCommand? _commandGoMainMenu;
+        public RelayCommand CommandGoMainMenu
+        {
+            get
+            {
+                return _commandGoMainMenu ??= new RelayCommand(
+                x =>
+                {
+                    AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Navigate(MainPage);
+                },
+                x =>
+                {
+                    if (AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Content is MainPage)
+                    {
+                        return false;
+                    }
+                    return true;
+                }
+                );
+            }
+        }
+        public RelayCommand? _commandGoAccount;
+        public RelayCommand CommandGoAccount
+        {
+            get
+            {
+                return _commandGoAccount ??= new RelayCommand(
+                x =>
+                {
+                    AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Navigate(AccountPage);
+                },
+                x =>
+                {
+                    if (AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Content is AccountPage)
+                    {
+                        return false;
+                    }
+                    return true;
+                }
+                );
+            }
+        }
+        public RelayCommand? _commandGoUserList;
+        public RelayCommand CommandGoUserList
+        {
+            get
+            {
+                return _commandGoUserList ??= new RelayCommand(
+                x =>
+                {
+                    AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Navigate(UserListPage);
+                },
+                x =>
+                {
+                    if (AppHelper.GetWindowAtType<UserWindow>()?.FramePages.Content is UserListPage)
+                    {
+                        return false;
+                    }
+                    return true;
+                }
+                );
+            }
+        }
+        public RelayCommand? _commandGoExit;
+        public RelayCommand CommandGoExit
+        {
+            get
+            {
+                return _commandGoExit ??= new RelayCommand(
+                x =>
+                {
+                    new MainWindow().Show();
+                    AppHelper.GetWindowAtType<UserWindow>()?.Close();
+                }
+                );
+            }
+        }
+    }
+}

+ 26 - 0
WpfApp29/WpfApp29.csproj

@@ -0,0 +1,26 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net6.0-windows</TargetFramework>
+    <Nullable>enable</Nullable>
+    <UseWPF>true</UseWPF>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Remove="bg.png" />
+    <None Remove="Pages\bg.png" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.4" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Resource Include="bg.png" />
+    <Resource Include="Pages\bg.png" />
+  </ItemGroup>
+
+</Project>

+ 74 - 0
WpfApp29/WpfApp29.csproj.user

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+  <ItemGroup>
+    <Compile Update="Pages\AccountPage.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="Pages\MainPage.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="Pages\UserListPage.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="RegistrationWindow.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="TaskCreationWindow.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserControls\TaskCreatorUserControl.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserControls\TaskDeleteUserControl.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserControls\TaskDoerUserControl.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserControls\TaskDoneUserControl.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserControls\TaskEmptyUserControl.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="UserWindow.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Page Update="Pages\AccountPage.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="Pages\MainPage.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="Pages\UserListPage.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="RegistrationWindow.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="TaskCreationWindow.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserControls\TaskCreatorUserControl.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserControls\TaskDeleteUserControl.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserControls\TaskDoerUserControl.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserControls\TaskDoneUserControl.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserControls\TaskEmptyUserControl.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Update="UserWindow.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+  </ItemGroup>
+</Project>

二进制
WpfApp29/bg.png