/// <summary> /// Fired when the generic message UI is tapped. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void GenericMessage_Tapped(object sender, TappedRoutedEventArgs e) { // If we are showing the content load fire it. if (m_isShowingContentLoadBlock) { OnContentLoadRequestArgs args = new OnContentLoadRequestArgs() { SourceId = SourceId }; m_onContentLoadRequest.Raise(this, args); // Set bars m_isShowingContentLoadBlock = false; ToggleGenericMessage(false); // Show loading ToggleProgress(true); } else { try { // Get the url, when we are unloaded we will not have a panel base // thus we have to get the source from the master. string url; if (m_currentPanelBase != null) { url = m_currentPanelBase.Source.Url; } else { // This could be null (but never should be), but if so we are f****d anyways. url = ContentPanelMaster.Current.GetSource(SourceId).Url; } await Windows.System.Launcher.LaunchUriAsync(new Uri(url, UriKind.Absolute)); } catch (Exception) { } } }
/// <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, OnContentLoadRequestArgs e) { // Find the post Post post = null; lock (m_postsLists) { foreach (FlipViewPostItem item in m_postsLists) { if (item.Context.Post.Id.Equals(e.SourceId)) { post = item.Context.Post; break; } } } // Send off a command to load it. if (post != null) { await Task.Run(() => { ContentPanelMaster.Current.AddAllowedContent(ContentPanelSource.CreateFromPost(post), m_uniqueId, false); }); } }
/// <summary> /// Fired when the user has tapped the panel requesting the content to load. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ContentPanelHost_OnContentLoadRequest(object sender, OnContentLoadRequestArgs e) { // Forward the call along. m_onContentLoadRequest.Raise(this, e); }