protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { if (this.CommonParameters.UserOrGroupId == 0L) { this.CommonParameters.UserOrGroupId = AppGlobalStateManager.Current.LoggedInUserId; } this.Initialize(); this.BuildAppBar(); this.PerformInitialLoad(); this.allAudio.IsInPickMode = this.CommonParameters.PickMode; this.UpdateAppBar(); this._isInitialized = true; } this.ProcessInputParameters(); CurrentMediaSource.AudioSource = this.CommonParameters.IsGroup ? StatisticsActionSource.audios_group : StatisticsActionSource.audios_user; FileOpenPickerContinuationEventArgs parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("FilePicked") as FileOpenPickerContinuationEventArgs; if (parameterForIdAndReset == null || !((IEnumerable <StorageFile>)parameterForIdAndReset.Files).Any <StorageFile>()) { return; } StorageFile file = ((IEnumerable <StorageFile>)parameterForIdAndReset.Files).First <StorageFile>(); this.SkipNextNavigationParametersRepositoryClearing = true; Navigator.Current.NavigateToAddNewAudio(file); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { base.DataContext = (new ChatEditViewModel(long.Parse(((Page)this).NavigationContext.QueryString["ChatId"]), ((Page)this).NavigationService)); this.ChatEditVM.Reload(true); this._isInitialized = true; } else { List <User> parameterForIdAndReset1 = ParametersRepository.GetParameterForIdAndReset("SelectedUsers") as List <User>; if (parameterForIdAndReset1 != null && Enumerable.Any <User>(parameterForIdAndReset1)) { this.ChatEditVM.AddMember((User)Enumerable.First <User>(parameterForIdAndReset1)); } List <Stream> parameterForIdAndReset2 = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; if (parameterForIdAndReset2 == null || !Enumerable.Any <Stream>(parameterForIdAndReset2)) { return; } Rect crop = new Rect(); if (ParametersRepository.Contains("UserPicSquare")) { crop = (Rect)ParametersRepository.GetParameterForIdAndReset("UserPicSquare"); } this.ChatEditVM.UpdatePhoto(parameterForIdAndReset2[0], crop); } }
private void ProcessInputParameters() { AudioAlbum pickedAlbum = ParametersRepository.GetParameterForIdAndReset("PickedAlbum") as AudioAlbum; if (pickedAlbum == null || !this.IsInMultiSelectMode) { return; } List <AudioHeader> headersToMove = this.GetSelectedAudioHeaders(); this.IsInMultiSelectMode = false; this.ViewModel.MoveTracksToAlbum(headersToMove, pickedAlbum, (Action <bool>)(result => Execute.ExecuteOnUIThread((Action)(() => { if (!result) { ExtendedMessageBox.ShowSafe(CommonResources.GenericErrorText); } else { if (MessageBox.Show(UIStringFormatterHelper.FormatNumberOfSomething(headersToMove.Count, AudioResources.OneAudioMovedFrm, AudioResources.TwoFourAudiosMovedFrm, AudioResources.FiveAudiosMovedFrm, true, pickedAlbum.title, false), AudioResources.MoveAudios, MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } Navigator.Current.NavigateToAudio(0, this.CommonParameters.UserOrGroupId, this.CommonParameters.IsGroup, pickedAlbum.album_id, 0, pickedAlbum.title); } })))); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type // PhotoPickerPhotos.<>c__DisplayClass25_0 cDisplayClass250 = new PhotoPickerPhotos.<>c__DisplayClass25_0(); // ISSUE: reference to a compiler-generated field // cDisplayClass250.<>4__this = this; base.HandleOnNavigatedTo(e); if (!this._isInitialized) { PhotoPickerPhotosViewModel pickerPhotosViewModel = new PhotoPickerPhotosViewModel(int.Parse(((Page)this).NavigationContext.QueryString["MaxAllowedToSelect"]), bool.Parse(((Page)this).NavigationContext.QueryString["OwnPhotoPick"])); pickerPhotosViewModel.PropertyChanged += new PropertyChangedEventHandler(this.vm_PropertyChanged); base.DataContext = pickerPhotosViewModel; this._pickToStorageFile = bool.Parse(((Page)this).NavigationContext.QueryString["PickToStorageFile"]); this._isInitialized = true; } object parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("CapturedPhoto"); // ISSUE: reference to a compiler-generated field bool haveCapturedPhoto = parameterForIdAndReset != null; // ISSUE: method pointer this.VM.LoadData(true, delegate { if (haveCapturedPhoto) { this.SelectCapturedPhoto(); } }); this.UpdateAppBar(); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); bool flag = true; if (!this._isInitialized) { IDictionary <string, string> queryString = this.NavigationContext.QueryString; this._ownerId = long.Parse(queryString["OwnerId"]); this._productId = long.Parse(queryString["ProductId"]); Product product = ParametersRepository.GetParameterForIdAndReset("Product") as Product; this.InitializeCommentVM(); this._viewModel = product != null ? new ProductViewModel(product) : new ProductViewModel(this._ownerId, this._productId); this._viewModel.PageLoadInfoViewModel.LoadingStateChangedCallback = new Action(this.OnLoadedStateChanged); this.DataContext = (object)this._viewModel; this._viewModel.Reload(); this.RestoreUnboundState(); this._isInitialized = true; flag = false; } if (!flag && (!e.IsNavigationInitiator || e.NavigationMode != NavigationMode.New)) { WallPostVMCacheManager.TryDeserializeInstance(this._commentVM); } this.ProcessInputData(); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); bool flag = true; if (!this._isInitialized) { this._ownerId = long.Parse(((Page)this).NavigationContext.QueryString["OwnerId"]); this._videoId = long.Parse(((Page)this).NavigationContext.QueryString["VideoId"]); string accessKey = ((Page)this).NavigationContext.QueryString["AccessKey"]; string videoContext = ""; if (((Page)this).NavigationContext.QueryString.ContainsKey("VideoContext")) { videoContext = ((Page)this).NavigationContext.QueryString["VideoContext"]; } VKClient.Common.Backend.DataObjects.Video parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("Video") as VKClient.Common.Backend.DataObjects.Video; StatisticsActionSource actionSource = (StatisticsActionSource)Enum.Parse(typeof(StatisticsActionSource), ((Page)this).NavigationContext.QueryString["VideoSource"]); this.InitializeCommentVM(); VideoCommentsViewModel commentsViewModel = new VideoCommentsViewModel(this._ownerId, this._videoId, accessKey, parameterForIdAndReset, actionSource, videoContext); commentsViewModel.PageLoadInfoViewModel.LoadingStateChangedCallback = new Action(this.OnLoadingStateChanged); base.DataContext = (commentsViewModel); commentsViewModel.Reload(true); this.RestoreUnboundState(); this._isInitialized = true; flag = false; } if (!flag && (!e.IsNavigationInitiator || e.NavigationMode != NavigationMode.New)) { WallPostVMCacheManager.TryDeserializeInstance(this._commentVM); } this.ProcessInputData(); this.UpdateAppBar(); }
private void ProcessInputParameters() { Group group = ParametersRepository.GetParameterForIdAndReset("PickedGroupForRepost") as Group; if (group != null) { foreach (IVirtualizable virtualizable in (Collection <IVirtualizable>) this._viewModel.WallVM.Collection) { WallPostItem wallPostItem = virtualizable as WallPostItem; if (wallPostItem != null && wallPostItem.LikesAndCommentsItem != null) { if (wallPostItem.LikesAndCommentsItem.ShareInGroupIfApplicable(group.id, group.name)) { break; } } } } List <Stream> streamList = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; Rect rect = new Rect(); if (ParametersRepository.Contains("UserPicSquare")) { rect = (Rect)ParametersRepository.GetParameterForIdAndReset("UserPicSquare"); } if (streamList == null || streamList.Count <= 0) { return; } this._viewModel.UploadProfilePhoto(streamList[0], rect); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isInitialized) { return; } long communityId = long.Parse(((Page)this).NavigationContext.QueryString["CommunityId"]); GroupType communityType = (GroupType)int.Parse(((Page)this).NavigationContext.QueryString["CommunityType"]); User parameterForIdAndReset = (User)ParametersRepository.GetParameterForIdAndReset("CommunityManager"); bool isEditing = ((Page)this).NavigationContext.QueryString.ContainsKey("IsContact"); bool fromPicker = ((Page)this).NavigationContext.QueryString.ContainsKey("FromPicker") && bool.Parse(((Page)this).NavigationContext.QueryString["FromPicker"]); bool isContact = false; string position = ""; string email = ""; string phone = ""; if (isEditing) { isContact = ((Page)this).NavigationContext.QueryString["IsContact"].ToLower() == "true"; position = Extensions.ForUI(((Page)this).NavigationContext.QueryString["Position"]); email = Extensions.ForUI(((Page)this).NavigationContext.QueryString["Email"]); phone = Extensions.ForUI(((Page)this).NavigationContext.QueryString["Phone"]); } ManagerEditingViewModel viewModel = new ManagerEditingViewModel(communityId, communityType, ((Page)this).NavigationService, parameterForIdAndReset, isContact, position, email, phone, isEditing, fromPicker); base.DataContext = viewModel; ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton(); Uri uri1 = new Uri("/Resources/check.png", UriKind.Relative); applicationBarIconButton1.IconUri = uri1; string appBarMenuSave = CommonResources.AppBarMenu_Save; applicationBarIconButton1.Text = appBarMenuSave; int num = viewModel.IsFormCompleted ? 1 : 0; applicationBarIconButton1.IsEnabled = (num != 0); ApplicationBarIconButton appBarButtonSave = applicationBarIconButton1; ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton(); Uri uri2 = new Uri("/Resources/appbar.cancel.rest.png", UriKind.Relative); applicationBarIconButton2.IconUri = uri2; string appBarCancel = CommonResources.AppBar_Cancel; applicationBarIconButton2.Text = appBarCancel; ApplicationBarIconButton applicationBarIconButton3 = applicationBarIconButton2; appBarButtonSave.Click += ((EventHandler)((p, f) => { ((Control)this).Focus(); viewModel.SaveChanges(false, ((Page)this).NavigationService); })); applicationBarIconButton3.Click += ((EventHandler)((p, f) => Navigator.Current.GoBack())); this.ApplicationBar = ((IApplicationBar)ApplicationBarBuilder.Build(new Color?(), new Color?(), 0.9)); viewModel.PropertyChanged += (PropertyChangedEventHandler)((p, f) => appBarButtonSave.IsEnabled = (viewModel.IsFormEnabled && viewModel.IsFormCompleted)); this.ApplicationBar.Buttons.Add(appBarButtonSave); this.ApplicationBar.Buttons.Add(applicationBarIconButton3); this._isInitialized = true; }
private void HandleInputParameters() { List <Stream> parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; if (parameterForIdAndReset == null || parameterForIdAndReset.Count <= 0) { return; } this.UploadPhotos(parameterForIdAndReset, 0); }
private void HandleInputParameters() { ValidationUserResponse parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("ValidationResponse") as ValidationUserResponse; if (parameterForIdAndReset == null) { return; } this.VM.HandleValidationResponse(parameterForIdAndReset); }
private void HandleInputParams() { List <User> parameterForIdAndReset1 = ParametersRepository.GetParameterForIdAndReset("SelectedUsers") as List <User>; List <FriendsList> parameterForIdAndReset2 = ParametersRepository.GetParameterForIdAndReset("SelectedLists") as List <FriendsList>; if (this.VM == null || parameterForIdAndReset2 == null && parameterForIdAndReset1 == null) { return; } this.VM.HandlePickedUsers(parameterForIdAndReset1, parameterForIdAndReset2); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isIntialized) { return; } this._viewModel = new UsersSearchParamsViewModel(ParametersRepository.GetParameterForIdAndReset("UsersSearchParams") as SearchParams); base.DataContext = this._viewModel; this._isIntialized = true; }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { string str = ""; if (((Page)this).NavigationContext.QueryString.ContainsKey("Name")) { str = ((Page)this).NavigationContext.QueryString["Name"]; } this._pickManaged = ((Page)this).NavigationContext.QueryString["PickManaged"] == bool.TrueString; this._shareContentDataProvider = ShareContentDataProviderManager.RetrieveDataProvider(); this._excludedId = long.Parse(((Page)this).NavigationContext.QueryString["ExcludedId"]); this._ownerId = long.Parse(((Page)this).NavigationContext.QueryString["OwnerId"]); this._picId = long.Parse(((Page)this).NavigationContext.QueryString["PicId"]); this._isGif = bool.Parse(((Page)this).NavigationContext.QueryString["IsGif"]); this._accessKey = ((Page)this).NavigationContext.QueryString["AccessKey"]; if (this._shareContentDataProvider is ShareExternalContentDataProvider) { ((Page)this).NavigationService.ClearBackStack(); } long userId = this.CommonParameters.UserId; string userName = str; int num = this._pickManaged ? 1 : 0; long excludedId = this._excludedId; GroupsListViewModel groupsListViewModel = new GroupsListViewModel(userId, userName, num != 0, excludedId); base.DataContext = ((object)groupsListViewModel); if (!this._pickManaged && this._shareContentDataProvider == null) { groupsListViewModel.AllVM.LoadData(false, false, (Action <BackendResult <VKList <Group>, ResultCode> >)null, false); } else { this.Header.HideSandwitchButton = true; this.SuppressMenu = true; ((PresentationFrameworkCollection <object>)((ItemsControl)this.pivot).Items).Remove((object)this.pivotItemAll); ((PresentationFrameworkCollection <object>)((ItemsControl)this.pivot).Items).Remove((object)this.pivotItemEvents); } long loggedInUserId = AppGlobalStateManager.Current.LoggedInUserId; if (userId != loggedInUserId) { ((PresentationFrameworkCollection <object>)((ItemsControl)this.pivot).Items).Remove((object)this.pivotItemManage); } this._isInitialized = true; } if (this._dialogService == null || !this._dialogService.IsOpen) { this.UpdateAppBar(); } this._text = ParametersRepository.GetParameterForIdAndReset("ShareText") as string; }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isInitialized) { return; } FriendRequestsViewModel requestsViewModel = new FriendRequestsViewModel(((Page)this).NavigationContext.QueryString.ContainsKey("AreSuggestedFriends") && bool.Parse(((Page)this).NavigationContext.QueryString["AreSuggestedFriends"])); requestsViewModel.ParentFriendRequestsUC = (FriendRequestsUC)ParametersRepository.GetParameterForIdAndReset("FriendRequestsUC"); base.DataContext = requestsViewModel; requestsViewModel.FriendRequestsVM.LoadData(false, false, null, false); this._isInitialized = true; }
private void HandleInputParams() { List <Stream> parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; Rect rect = new Rect(); if (ParametersRepository.Contains("UserPicSquare")) { rect = (Rect)ParametersRepository.GetParameterForIdAndReset("UserPicSquare"); } if (parameterForIdAndReset == null || parameterForIdAndReset.Count <= 0) { return; } this.RegistrationVM.SetUserPhoto(parameterForIdAndReset[0], rect); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { this.DataContext = (object)new SettingsNewViewModel(); this.ViewModel.LoadCurrentUser(); this._isInitialized = true; } List <Stream> streamList = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; if (streamList == null || streamList.Count <= 0) { return; } //this.ViewModel.SetUserPicture(streamList[0], "newProfilePhoto.jpg");//TODO: функция SetUserPicture не имеет реализации (автор не сделал) }
private void ProcessInputParameters() { Group parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("PickedGroupForRepost") as Group; if (parameterForIdAndReset == null) { return; } foreach (IVirtualizable virtualizable in (Collection <IVirtualizable>) this.GroupVM.WallVM.Collection) { WallPostItem wallPostItem = virtualizable as WallPostItem; if (wallPostItem != null && wallPostItem.LikesAndCommentsItem != null && wallPostItem.LikesAndCommentsItem.ShareInGroupIfApplicable(parameterForIdAndReset.id, parameterForIdAndReset.name)) { break; } } }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isInitialized) { return; } this._section_id = this.NavigationContext.QueryString["SectionId"]; this._next = this.NavigationContext.QueryString["Next"]; this._name = this.NavigationContext.QueryString["Name"]; StatisticsActionSource source = (StatisticsActionSource)int.Parse(this.NavigationContext.QueryString["Source"]); string context = this.NavigationContext.QueryString["Context"]; VKList <VideoCatalogItem> vkList = ParametersRepository.GetParameterForIdAndReset("CatalogItemsToShow") as VKList <VideoCatalogItem>; int num1 = vkList != null ? 1 : 0; if (num1 == 0) { VideoListPage.VideoListData videoListData = new VideoListPage.VideoListData(); CacheManager.TryDeserialize((IBinarySerializable)videoListData, this._section_id + "cached", CacheManager.DataType.CachedData); vkList = new VKList <VideoCatalogItem>() { count = videoListData.count, groups = videoListData.groups, profiles = videoListData.profiles, items = videoListData.items }; } VideoListViewModel videoListViewModel = new VideoListViewModel(vkList ?? new VKList <VideoCatalogItem>(), this._section_id, this._next, this._name, source, context); this.DataContext = (object)videoListViewModel; videoListViewModel.VideosGenCol.LoadData(true, false, (Action <BackendResult <GetCatalogSectionResponse, ResultCode> >)null, false); if (num1 != 0) { VideoListPage.VideoListData videoListData = new VideoListPage.VideoListData(); videoListData.count = vkList.count; videoListData.groups = vkList.groups; videoListData.profiles = vkList.profiles; videoListData.items = vkList.items; string fileId = this._section_id + "cached"; int num2 = 0; int num3 = 0; CacheManager.TrySerializeAsync((IBinarySerializable)videoListData, fileId, num2 != 0, (CacheManager.DataType)num3); } this._isInitialized = true; }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isInitialized) { this._inputData = ParametersRepository.GetParameterForIdAndReset("EditPrivacyInputData") as EditPrivacyPageInputData; if (this._inputData == null) { Navigator.Current.GoBack(); } else { base.DataContext = (new EditPrivacyViewModel(this._inputData.PrivacyForEdit, this._inputData.UpdatePrivacyCallback)); this._isInitialized = true; } } this.HandleInputParams(); }
private void HandleInputParams() { FileOpenPickerContinuationEventArgs continuationEventArgs = ParametersRepository.GetParameterForIdAndReset("FilePicked") as FileOpenPickerContinuationEventArgs; if (continuationEventArgs == null || !((IEnumerable <StorageFile>)continuationEventArgs.Files).Any <StorageFile>()) { return; } StorageFile storageFile = ((IEnumerable <StorageFile>)continuationEventArgs.Files).First <StorageFile>(); string filePath = storageFile.Path; if (filePath.StartsWith("C:\\Data\\Users\\DefApps\\APPDATA\\Local\\Packages\\")) { AddEditVideoViewModel.PickedExternalFile = storageFile; filePath = ""; } Navigator.Current.NavigateToAddNewVideo(filePath, AppGlobalStateManager.Current.LoggedInUserId); }
private void HandleInputParams() { FileOpenPickerContinuationEventArgs parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("FilePicked") as FileOpenPickerContinuationEventArgs; if (parameterForIdAndReset == null || !parameterForIdAndReset.Files.Any <StorageFile>()) { return; } StorageFile storageFile = parameterForIdAndReset.Files.First <StorageFile>(); string filePath = storageFile.Path; if (filePath.StartsWith("C:\\Data\\Users\\DefApps\\APPDATA\\Local\\Packages\\")) { AddEditVideoViewModel.PickedExternalFile = storageFile; filePath = ""; } Navigator.Current.NavigateToAddNewVideo(filePath, this.CommonParameters.IsGroup ? -this.CommonParameters.UserOrGroupId : this.CommonParameters.UserOrGroupId); }
protected override async void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isInitialized) { return; } User parameterForIdAndReset = (User)ParametersRepository.GetParameterForIdAndReset("MoneyTransferTargetUser"); long targetId = long.Parse(((Page)this).NavigationContext.QueryString["TargetId"]); int amount = int.Parse(((Page)this).NavigationContext.QueryString["Amount"]); string comment = Extensions.ForUI(((Page)this).NavigationContext.QueryString["Comment"]); this._viewModel = new SendMoneyViewModel(targetId, parameterForIdAndReset, amount, comment); await Task.Delay(1); base.DataContext = this._viewModel; this._viewModel.Load(); this._isInitialized = true; }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); SystemTray.IsVisible = false; this.SubscribeToFrameReported(); AccelerometerHelper.Instance.IsActive = true; DeviceOrientationHelper.Instance.OrientationChanged += new EventHandler <DeviceOrientationChangedEventArgs>(this.OnOrientationChanged); if (!this._isInitialized) { User user = null; ChatExtended chat = null; IDictionary <string, string> queryString = base.NavigationContext.QueryString; string index1 = "UserOrChatId"; long result1; long.TryParse(queryString[index1], out result1); string index2 = "IsChat"; bool result2; bool.TryParse(queryString[index2], out result2); string index3 = "Title"; this.textBlockRecipientName.Text = (HttpUtility.UrlDecode(queryString[index3])); this.textBlockRecipientName.CorrectText(480.0 - ((FrameworkElement)this.gridRecipientAvatar).Width - 32.0 - 12.0); this.AlignRecipientInfo(); ConversationInfo parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("ConversationInfo") as ConversationInfo; if (parameterForIdAndReset != null) { user = parameterForIdAndReset.User; chat = parameterForIdAndReset.Chat; } this._viewModel = new GraffitiDrawViewModel(result1, result2, user, chat); base.DataContext = this._viewModel; this._viewModel.LoadHeaderInfo(); this._graffitiDrawService.StrokeBrush = new SolidColorBrush(this.ucGraffitiPallete.CurrentColor); this._graffitiDrawService.StrokeThickness = this.ucBrushThickness.CurrentThickness; this.ucBrushThickness.SetFillColor(this.ucGraffitiPallete.CurrentColor); this._isInitialized = true; } this.HandleOrientationChange(DeviceOrientationHelper.Instance.CurrentOrientation); if (!base.State.ContainsKey("GraffitiPageState")) { return; } this.RestoreState(base.State["GraffitiPageState"] as GraffitiCacheData); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); bool flag = true; if (!this._isInitialized) { this._ownerId = long.Parse(((Page)this).NavigationContext.QueryString["ownerId"]); this._pid = long.Parse(((Page)this).NavigationContext.QueryString["pid"]); string accessKey = ((Page)this).NavigationContext.QueryString["accessKey"]; Photo parameterForIdAndReset1 = ParametersRepository.GetParameterForIdAndReset("Photo") as Photo; PhotoWithFullInfo parameterForIdAndReset2 = ParametersRepository.GetParameterForIdAndReset("PhotoWithFullInfo") as PhotoWithFullInfo; this._friendsOnly = ((Page)this).NavigationContext.QueryString["FriendsOnly"] == bool.TrueString; this._fromDialog = ((Page)this).NavigationContext.QueryString["FromDialog"] == bool.TrueString; PhotoViewModel photoViewModel; if (parameterForIdAndReset1 == null) { photoViewModel = new PhotoViewModel(this._ownerId, this._pid, accessKey); } else { if (string.IsNullOrEmpty(parameterForIdAndReset1.access_key)) { parameterForIdAndReset1.access_key = accessKey; } photoViewModel = new PhotoViewModel(parameterForIdAndReset1, parameterForIdAndReset2); } this.InitializeCommentVM(); base.DataContext = photoViewModel; // ISSUE: method pointer photoViewModel.LoadInfoWithComments(new Action <bool, int>(this.OnPhotoInfoLoaded)); this.RestoreUnboundState(); this._isInitialized = true; flag = false; } if (!flag && (!e.IsNavigationInitiator || e.NavigationMode != NavigationMode.New)) { WallPostVMCacheManager.TryDeserializeInstance(this._commentVM); } this.ProcessInputData(); this.UpdateAppBar(); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (this._isInitialized) { return; } this._isInitialized = true; AddEditAudioViewModel viewModel = new AddEditAudioViewModel((StorageFile)ParametersRepository.GetParameterForIdAndReset("AudioForUpload"), (AudioObj)ParametersRepository.GetParameterForIdAndReset("AudioForEdit")); base.DataContext = viewModel; ApplicationBarIconButton applicationBarIconButton1 = new ApplicationBarIconButton(); Uri uri1 = new Uri("/Resources/check.png", UriKind.Relative); applicationBarIconButton1.IconUri = uri1; string appBarMenuSave = CommonResources.AppBarMenu_Save; applicationBarIconButton1.Text = appBarMenuSave; int num = !viewModel.IsFormCompleted ? 0 : (viewModel.IsFormEnabled ? 1 : 0); applicationBarIconButton1.IsEnabled = (num != 0); ApplicationBarIconButton appBarButtonSave = applicationBarIconButton1; ApplicationBarIconButton applicationBarIconButton2 = new ApplicationBarIconButton(); Uri uri2 = new Uri("/Resources/appbar.cancel.rest.png", UriKind.Relative); applicationBarIconButton2.IconUri = uri2; string appBarCancel = CommonResources.AppBar_Cancel; applicationBarIconButton2.Text = appBarCancel; ApplicationBarIconButton applicationBarIconButton3 = applicationBarIconButton2; appBarButtonSave.Click += ((EventHandler)((p, f) => { ((Control)this).Focus(); viewModel.SaveChanges(); })); applicationBarIconButton3.Click += ((EventHandler)((p, f) => Navigator.Current.GoBack())); this.ApplicationBar = ((IApplicationBar)ApplicationBarBuilder.Build(new Color?(), new Color?(), 0.9)); viewModel.PropertyChanged += (PropertyChangedEventHandler)((p, f) => appBarButtonSave.IsEnabled = (viewModel.IsFormCompleted && viewModel.IsFormEnabled)); this.ApplicationBar.Buttons.Add(appBarButtonSave); this.ApplicationBar.Buttons.Add(applicationBarIconButton3); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); bool flag = true; if (!this._isInitialized) { ((UIElement)this.ucNewMessage).Opacity = 0.0; NewsItemDataWithUsersAndGroupsInfo parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("WallPost") as NewsItemDataWithUsersAndGroupsInfo; long num1 = long.Parse(((Page)this).NavigationContext.QueryString["PollId"]); long num2 = long.Parse(((Page)this).NavigationContext.QueryString["PollOwnerId"]); if (this.FocusComments) { this.panel.OnlyPartialLoad = true; } long postId = this.CommonParameters.PostId; long ownerId = this.CommonParameters.OwnerId; MyVirtualizingPanel2 panel = this.panel; Action loadedCallback = new Action(this.ViewModelIsLoaded); Action <CommentItem> replyCommentAction = new Action <CommentItem>(this.ReplyToComment); long knownPollId = num1; long knownPollOwnerId = num2; PostCommentsViewModel commentsViewModel = new PostCommentsViewModel(parameterForIdAndReset, postId, ownerId, panel, loadedCallback, replyCommentAction, knownPollId, knownPollOwnerId); this.InitializeCommentVM(); base.DataContext = commentsViewModel; commentsViewModel.LoadMoreCommentsInUI(); this.UpdateAppBar(); this.RestoreUnboundState(); this.ucPullToRefresh.TrackListBox((ISupportPullToRefresh)this.panel); this.panel.OnRefresh = new Action(this.Refresh); this._isInitialized = true; flag = false; } if (!flag && (!e.IsNavigationInitiator || e.NavigationMode != NavigationMode.New)) { WallPostVMCacheManager.TryDeserializeInstance(this._commentVM); } this.ProcessInputData(); PostCommentsPage.HandleInputParams(this._commentVM); this.UpdateAppBar(); }
private void HandleInputParams() { List <User> parameterForIdAndReset1 = ParametersRepository.GetParameterForIdAndReset("SelectedUsers") as List <User>; if (parameterForIdAndReset1 != null && parameterForIdAndReset1.Count >= 1) { this.VM.Partner = parameterForIdAndReset1[0]; } List <Stream> parameterForIdAndReset2 = ParametersRepository.GetParameterForIdAndReset("ChoosenPhotos") as List <Stream>; Rect rect = new Rect(); if (ParametersRepository.Contains("UserPicSquare")) { rect = (Rect)ParametersRepository.GetParameterForIdAndReset("UserPicSquare"); } if (parameterForIdAndReset2 == null || parameterForIdAndReset2.Count <= 0) { return; } this.VM.UploadUserPhoto(parameterForIdAndReset2[0], rect); }
protected override void HandleOnNavigatedTo(NavigationEventArgs e) { base.HandleOnNavigatedTo(e); if (!this._isIntialized) { SearchParams searchParams = ParametersRepository.GetParameterForIdAndReset("ProductsSearchParams") as SearchParams; IDictionary <string, string> queryString = this.NavigationContext.QueryString; string index1 = "PriceFrom"; long priceMin = long.Parse(queryString[index1]); string index2 = "PriceTo"; long priceMax = long.Parse(queryString[index2]); string index3 = "CurrencyId"; int.Parse(queryString[index3]); string index4 = "CurrencyName"; string currencyName = queryString[index4]; this._viewModel = new ProductsSearchParamsViewModel(priceMin, priceMax, currencyName, searchParams); this.DataContext = (object)this._viewModel; this._isIntialized = true; } CurrentMarketItemSource.Source = MarketItemSource.market; }