Example #1
0
        public BoardViewModel(LoadingViewModel loading, NavigationServiceInternal navigationService,
                              Repo repository, LoginResponseHandler responseHandler, MessageBoxViewModel messageBoxViewModel)
            : base(loading, navigationService, repository, responseHandler, messageBoxViewModel)
        {
            Messenger.Default.Register <IViewModelsState>(this, param =>
            {
                if (LastDisabled != null && LastDisabled != param)
                {
                    LastDisabled.ChangeLastState();
                }
                LastDisabled = param;
                LastDisabled = param;
            });

            Messenger.Default.Register <ObservableCollection <ColumnViewModel> >
                (this, param => BoardLists = param);

            Messenger.Default.Register <MyProject>
                (this, param => CurrentProject = param);

            Messenger.Default.Register <string>(this, param =>
                                                ImageSource = "/Images/expand.png");

            Messenger.Default.Register <bool>(this, param => BackgroundColorStart = param);

            AddAnotherListButton = true;
            ImageSource          = "/Images/expand.png";

            BackgroundColor      = false;
            BackgroundColorStart = false;
        }
Example #2
0
        public ProjectsListViewModel(LoadingViewModel loadingViewModel,
                                     NavigationServiceInternal InternalNavigationService, Repo repository,
                                     LoginResponseHandler responseHandler, BoardViewModel boardViewModel, MessageBoxViewModel messageBoxViewModel)
            : base(loadingViewModel, InternalNavigationService, repository, responseHandler, messageBoxViewModel)
        {
            #region MockData
            var projectsFromDataBase = new ObservableCollection <Project>()
            {
                new Project {
                    Name = "Some project", BoardLists = new List <BoardList>()
                    {
                        new BoardList()
                        {
                            Name = "ToDo", Cards = new List <Card>()
                            {
                                new Card()
                                {
                                    Name = "Create database"
                                },
                                new Card()
                                {
                                    Name = "adasdasd"
                                },
                                new Card()
                                {
                                    Name = "asdasdasdasdasdasd database"
                                },
                                new Card()
                                {
                                    Name = "Creaasdasdasd asd asd asd asdasdasd asdasdas te database"
                                },
                            }
                        },
                        new BoardList()
                        {
                            Name = "Doing", Cards = new List <Card>()
                            {
                                new Card()
                                {
                                    Name = "adasdasd"
                                },
                                new Card()
                                {
                                    Name = "asdasd asdasad sdasadasdas dasd aadasdas"
                                },
                                new Card()
                                {
                                    Name = "Creaasdasdasd asd asd asd asda"
                                },
                            }
                        },
                        new BoardList()
                        {
                            Name = "Done", Cards = new List <Card>()
                        }
                    },
                    Notifications = new List <Notification>()
                    {
                        new Notification()
                        {
                            Name = "sgfsd"
                        },
                        new Notification()
                        {
                            Name = "sdssdfs dfsdfsdf"
                        },
                    }
                },
                new Project {
                    Name = "Another", BoardLists = new List <BoardList>()
                    {
                        new BoardList()
                        {
                            Name = "ToDo", Cards = new List <Card>()
                            {
                                new Card()
                                {
                                    Name = "Creadsadasdasnda sdasd  asd asd asd a sdasd asdasdasd ate database"
                                },
                                new Card()
                                {
                                    Name = "adasasd asd asd asdasddasd"
                                },
                                new Card()
                                {
                                    Name = "asdasdasdasdasdasd database"
                                },
                            }
                        },
                        new BoardList()
                        {
                            Name = "Doing", Cards = new List <Card>()
                        },
                        new BoardList()
                        {
                            Name = "Done", Cards = new List <Card>()
                        }
                    }, Notifications = new List <Notification>()
                    {
                        new Notification()
                        {
                            Name = "sgfs  ssdd"
                        },
                        new Notification()
                        {
                            Name = "sdsssd fsdf sdaaaaa aaa"
                        },
                        new Notification()
                        {
                            Name = "sds sdfs dfsdf sdf"
                        }
                    }
                },
                new Project {
                    Name = "Project", BoardLists = new List <BoardList>()
                    {
                        new BoardList()
                        {
                            Name = "ToDo", Cards = new List <Card>()
                            {
                                new Card()
                                {
                                    Name = "Creasasda sdnas d as d asd asate database"
                                },
                                new Card()
                                {
                                    Name = "adaasd as das d assdasd"
                                },
                                new Card()
                                {
                                    Name = "asdasasdasd asd asd as d asd as d asd asd as d asd asd asd as d s s s s s ssssdasdasdasdasd database"
                                },
                                new Card()
                                {
                                    Name = "Creaasdasdasd asd asd asd asdasdasd asdasdas te database"
                                },
                                new Card()
                                {
                                    Name = "Create database"
                                },
                                new Card()
                                {
                                    Name = "adasdasd"
                                },
                                new Card()
                                {
                                    Name = "asdasdasdasdasdasd database"
                                },
                                new Card()
                                {
                                    Name = "Creaasdasdasd asd asd asd asdasdasd asdasdas te database"
                                },
                            }
                        },
                        new BoardList()
                        {
                            Name = "Doing", Cards = new List <Card>()
                        },
                        new BoardList()
                        {
                            Name = "Done", Cards = new List <Card>()
                        }
                    }, Notifications = new List <Notification>()
                },
                new Project()
                {
                    Name = "sdfsdf", BoardLists = new List <BoardList>(), Notifications = new List <Notification>()
                },
                new Project()
                {
                    Name = "sdfsdf", BoardLists = new List <BoardList>(), Notifications = new List <Notification>()
                },
                new Project()
                {
                    Name = "sdfsdf", BoardLists = new List <BoardList>(), Notifications = new List <Notification>()
                },
                new Project()
                {
                    Name = "sdfsdf", BoardLists = new List <BoardList>(), Notifications = new List <Notification>()
                }
            };
            #endregion

            CurrentViewModel = boardViewModel;
            Projects         = new ObservableCollection <MyProject>();

            foreach (var item in projectsFromDataBase)
            {
                Projects.Add(Converter(item));
            }

            for (int i = 0; i < 1000; i++)
            {
                Projects
                .FirstOrDefault()
                .Notifications.Add(new Notification()
                {
                    Name = "sgfsd"
                });
            }

            SetProject(Projects.FirstOrDefault());
        }