public TaskPageViewModel(NavigationService navigation) { this.navigation = navigation; if (CurrentTask.Instance.Task.Image == null) { TaskImgPath = new BitmapImage(new Uri(Path.Combine(Environment.CurrentDirectory + "\\empty_task_img.png"))); } else { TaskImgPath = ProfilePhoto.ByteArrayToImage(CurrentTask.Instance.Task.Image); } ColumnTitle = CurrentColumn.Instance.Column.Title; TaskTitle = CurrentTask.Instance.Task.Title; Deadline = CurrentTask.Instance.Task.Deadline; AssignedTo = CurrentTask.Instance.Task.AssignedTo; Description = CurrentTask.Instance.Task.Description; CreatedAt = "Created at: " + CurrentTask.Instance.Task.CreatedAt.Humanize(); CurrentKanbanState = CurrentProject.Instance.KanbanStates.FirstOrDefault(x => x.Name.Equals(CurrentTask.Instance.Task.CurrentKanbanState)).Name; timer = new System.Timers.Timer(1000); timer.Start(); timer.Elapsed += Timer_Elapsed; }
public SignUpViewModel(NavigationService navigation) { this.navigation = navigation; this.userService = new UserService(); if (CurrentUser.Instance.User.Image == null) { ProfileImgPath = new BitmapImage(new Uri(Path.Combine(Environment.CurrentDirectory + "\\user.png"))); } else { ProfileImgPath = ProfilePhoto.ByteArrayToImage(CurrentUser.Instance.User.Image); } }
public EditTaskViewModel(NavigationService navigationService) { this.navigationService = navigationService; taskService = new TaskService(); userRoleService = new UserRoleService(); columnService = new ColumnService(); taskLogService = new TaskLogService(); taskService.GetKanbanStatesOfTask(); userRoleService.LoadRoles(CurrentProject.Instance.Project.Id); Title = CurrentTask.Instance.Task.Title; ProjectTitle = CurrentProject.Instance.Project.Name; SelectedEmployee = CurrentUserRoles.Instance.Employees.FirstOrDefault(x => x.FullName.Equals(CurrentTask.Instance.Task.AssignedTo)); Deadline = CurrentTask.Instance.Task.Deadline; CurrentKanbanState = CurrentProject.Instance.KanbanStates.FirstOrDefault(x => x.Name.Equals(CurrentTask.Instance.Task.CurrentKanbanState)); Description = CurrentTask.Instance.Task.Description; if (CurrentTask.Instance.Task.Image == null) { TaskImgPath = new BitmapImage(new Uri(Path.Combine(Environment.CurrentDirectory + "\\empty_task_img.png"))); } else { TaskImgPath = ProfilePhoto.ByteArrayToImage(CurrentTask.Instance.Task.Image); } userRoleService.LoadRoles(CurrentProject.Instance.Project.Id); SelectedEmployee = CurrentUserRoles.Instance.Employees.FirstOrDefault(x => x.FullName.Equals(CurrentTask.Instance.Task.AssignedTo)); CreatedAt = "Created at: " + CurrentTask.Instance.Task.CreatedAt.Humanize(); timer = new System.Timers.Timer(1000); timer.Start(); timer.Elapsed += Timer_Elapsed; }