Exemple #1
0
        // CONSTRUCTORS
        /// <summary>
        /// Initialize a new instance of <see cref="MainWindowViewModel"/>
        /// </summary>
        public MainWindowViewModel()
        {
            this.selectedPhotoIndex = Core.Configuration.Constants.WRONG_INDEX;
            this.selectedPhoto      = null;
            this.photos             = new Collections.ReverseCollection <DataAccess.Entities.Photo>(DataStorage.ShownUser.Photos);

            if (IsCurrentUserShown)
            {
                this.isFollowing = false;
            }
            else
            {
                this.isFollowing = DataStorage.ShownUser.Followers.Contains(DataStorage.LoggedUser);
            }

            this.goHomeCommand         = new Commands.User.MainWindow.GoHomeCommand(this);
            this.askQuestionCommand    = new Commands.User.MainWindow.AskQuestionCommand(this);
            this.followCommand         = new Commands.User.MainWindow.FollowCommand(this);
            this.logOutCommand         = new Commands.User.MainWindow.LogOutCommand();
            this.searchUserCommand     = new Commands.User.MainWindow.SearchUserCommand(this);
            this.settingCommand        = new Commands.User.MainWindow.SettingCommand(this);
            this.showFollowListCommand = new Commands.User.MainWindow.ShowFollowListCommand(this);
            this.showPhotoCommand      = new Commands.User.MainWindow.ShowPhotoCommand(this);
            this.uploadPhotoCommand    = new Commands.User.MainWindow.UploadPhotoCommand(this);
        }
Exemple #2
0
        // METHODS
        /// <summary>
        /// Sets logged user as shown one
        /// </summary>
        public void GoToCurrentUser()
        {
            DataStorage.ShowLoggedUser();
            photos = new Collections.ReverseCollection <DataAccess.Entities.Photo>(DataStorage.ShownUser.Photos);

            OnPropertyChanged(nameof(User));
            OnPropertyChanged(nameof(Photos));
        }