/// <summary> /// Fired when the user has tapped the panel requesting the content to load. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void FlipViewPostPanel_OnContentLoadRequest(object sender, ContentLoadRequestArgs e) { // Find the post Post post = null; lock (_postsLists) { foreach (var item in _postsLists) { if (!item.Context.Post.Id.Equals(e.SourceId)) { continue; } post = item.Context.Post; break; } } // Send off a command to load it. if (post != null) { await Task.Run(() => { ContentPanelMaster.Current.AddAllowedContent(ContentPanelSource.CreateFromPost(post), _uniqueId); }); } }
/// <summary> /// Sets the post content. For now all we give the flip view control is the URL /// and it must figure out the rest on it's own. /// </summary> /// <param name="item"></param> /// <param name="isVisiblePost"></param> private async Task SetPostContent(FlipViewPostItem item, bool isVisiblePost) { // Set that the post is visible if it is item.IsVisible = isVisiblePost; // Only load the content if we are doing it with out action. (most of the time) if (App.BaconMan.UiSettingsMan.FlipViewLoadPostContentWithoutAction) { await Task.Run(() => { ContentPanelMaster.Current.AddAllowedContent(ContentPanelSource.CreateFromPost(item.Context.Post), _uniqueId, !isVisiblePost); }); } }