/// <summary> /// Gets the selection changed of the topic list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TopicLongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selectedItem = (TopicViewModel)TopicLongListSelector.SelectedItem; if (selectedItem != null) { var topic = new TopicViewModel() { TopicID = selectedItem.TopicID }; NavigationService.Navigate(new Uri("/Topic.xaml", UriKind.Relative), topic); //await ApiController.SubmitPost(211602, "Tak for tippet @lmnDK :-) \n Skrevet fra WP8 App."); } }
/// <summary> /// Handles click event of submit topic /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void uiButtonSubmitTopic_Click(object sender, RoutedEventArgs e) { var progress = new ProgressIndicator { IsVisible = true, IsIndeterminate = true, Text = "Submitting new topic..." }; SystemTray.SetProgressIndicator(this, progress); var topicSubjectText = uiTextBoxTopicSubject.Text; var topicContentText = uiTextBoxTopicContent.Text; if ((!string.IsNullOrEmpty(topicSubjectText) && topicSubjectText.Length >= 5) && (!string.IsNullOrEmpty(topicContentText) && topicContentText.Length >= 5)) { await ApiController.SubmitTopic(m_ForumID, topicSubjectText, topicContentText); } progress.IsVisible = false; var topic = new TopicViewModel() { TopicID = m_ForumTopic.Id }; NavigationService.Navigate(new Uri("/Topic.xaml", UriKind.Relative), topic); }