コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        protected override void HandleOnNavigatedTo(NavigationEventArgs e)
        {
            base.HandleOnNavigatedTo(e);
            bool flag1 = true;

            if (!this._isInitialized)
            {
                long   gid                 = long.Parse(((Page)this).NavigationContext.QueryString["GroupId"]);
                long   num1                = long.Parse(((Page)this).NavigationContext.QueryString["TopicId"]);
                string str                 = ((Page)this).NavigationContext.QueryString["TopicName"];
                int    num2                = int.Parse(((Page)this).NavigationContext.QueryString["KnownCommentsCount"]);
                bool   flag2               = ((Page)this).NavigationContext.QueryString["LoadFromTheEnd"] == bool.TrueString;
                bool   flag3               = ((Page)this).NavigationContext.QueryString["CanComment"] == bool.TrueString;
                long   tid                 = num1;
                string topicName           = str;
                int    knownCommentsCount  = num2;
                int    num3                = flag3 ? 1 : 0;
                MyVirtualizingPanel2 panel = this.panel;
                int num4 = flag2 ? 1 : 0;
                Action <CommentItem>     replyCallback       = new Action <CommentItem>(this.replyCallback);
                GroupDiscussionViewModel discussionViewModel = new GroupDiscussionViewModel(gid, tid, topicName, knownCommentsCount, num3 != 0, panel, num4 != 0, replyCallback);
                this.InitializeCommentVM();
                base.DataContext = ((object)discussionViewModel);
                discussionViewModel.LoadData(false, new Action <bool>(this.LoadedCallback));
                this.UpdateAppBar();
                this.RestoreUnboundState();
                this._isInitialized = true;
                flag1 = false;
            }
            if (!flag1 && (!e.IsNavigationInitiator || e.NavigationMode != NavigationMode.New))
            {
                WallPostVMCacheManager.TryDeserializeInstance(this._commentVM);
            }
            this.ProcessInputData();
            this.UpdateAppBar();
        }