public NewsCommentsItem(double width, Thickness margin, NewsItemDataWithUsersAndGroupsInfo newsItemData, Action <string> unsubscribedCallback) : base(width, margin, new Thickness()) { this._newsItemData = newsItemData; this._unsubscribedCallback = unsubscribedCallback; this.GenerateVirtualizableChildren(); this._view.Tap += new EventHandler <System.Windows.Input.GestureEventArgs>(this._view_Tap); }
public VideosNewsItem(double width, Thickness margin, NewsItemDataWithUsersAndGroupsInfo newsItemWithInfo, Action <long, User, Group> hideFromNewsCallback, Action <NewsFeedIgnoreItemData> ignoreNewsfeedItemCallback) : base(width, margin, new Thickness()) { this._newsItemWithInfo = newsItemWithInfo; this._ignoreNewsfeedItemCallback = ignoreNewsfeedItemCallback; this.HideSourceItemsCallback = hideFromNewsCallback; List <User> profiles = newsItemWithInfo.Profiles; List <Group> groups = newsItemWithInfo.Groups; if (this._newsItemWithInfo.NewsItem.source_id < 0L) { this._fromGroup = groups.FirstOrDefault <Group>((Func <Group, bool>)(g => g.id == -this.OwnerId)) ?? GroupsService.Current.GetCachedGroup(-this.OwnerId) ?? new Group(); } else { this._fromUser = profiles.FirstOrDefault <User>((Func <User, bool>)(p => p.uid == this.OwnerId)) ?? new User(); } this.GenerateLayout(); }
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(); }
public FriendsRecommendationsNewsItemUC(NewsItemDataWithUsersAndGroupsInfo newsItem) { this.InitializeComponent(); ((PresentationFrameworkCollection <UIElement>)((Panel)this.MainPanel).Children).Add((UIElement) new FriendsRecommendationsUC(newsItem)); }