Example #1
0
 public CreateEditAlbumViewModel(Album album, Action <Album> notifyOnCompletion, long gid = 0)
 {
     this._album              = album;
     this._isNewMode          = string.IsNullOrEmpty(album.aid);
     this.Name                = this._album.title ?? "";
     this.Description         = this._album.description ?? "";
     this.AccessTypeComments  = AccessTypesList.AccessTypes.FirstOrDefault <AccessType>((Func <AccessType, bool>)(a => a.Id == this._album.comment_privacy));
     this._notifyOnCompletion = notifyOnCompletion;
     this._gid                = gid;
     this._privacyViewVM      = new EditPrivacyViewModel(PhotoResources.CreateAlbumUC_Access, this._album.PrivacyViewInfo, "", (List <string>)null);
 }
Example #2
0
        public async Task <IActionResult> EditPrivacy(EditPrivacyViewModel viewModel)
        {
            User currentUser = await userManager.GetUserAsync(HttpContext.User);

            PrivacySetting privacySettings = context.PrivacySettings.Where(s => s.User == currentUser).Single();

            privacySettings.ShowProfileToFriends = viewModel.ShowProfileToFriends;
            privacySettings.ShowProfileToWorld   = viewModel.ShowProfileToWorld;
            await context.SaveChangesAsync();

            return(RedirectToAction("Edit", new { option = "Privacy" }));
        }
        public static AddEditVideoViewModel CreateForNewVideo(string filePath, long ownerId)
        {
            AddEditVideoViewModel editVideoViewModel = new AddEditVideoViewModel();

            editVideoViewModel._ownerId  = ownerId;
            editVideoViewModel._filePath = filePath;
            EditPrivacyViewModel privacyViewModel1 = new EditPrivacyViewModel(CommonResources.AddEditVideo_WhoCanView, new PrivacyInfo(), "", null);

            editVideoViewModel.ViewVideoPrivacyVM = privacyViewModel1;
            EditPrivacyViewModel privacyViewModel2 = new EditPrivacyViewModel(CommonResources.AddEditVideo_WhoCanComment, new PrivacyInfo(), "", null);

            editVideoViewModel.CommentVideoPrivacyVM = privacyViewModel2;
            editVideoViewModel.PrepareVideo();
            return(editVideoViewModel);
        }
Example #4
0
        private void PrivacyTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            FrameworkElement originalSource = ((RoutedEventArgs)e).OriginalSource as FrameworkElement;

            if (originalSource == null)
            {
                return;
            }
            EditPrivacyViewModel vm = originalSource.DataContext as EditPrivacyViewModel;

            if (vm == null)
            {
                return;
            }
            Navigator.Current.NavigateToEditPrivacy(new EditPrivacyPageInputData()
            {
                PrivacyForEdit        = vm,
                UpdatePrivacyCallback = (Action <PrivacyInfo>)(pi => this.VM.UpdatePrivacy(vm, pi))
            });
        }