コード例 #1
0
        private void innerThread_Tapped(object sender, TappedRoutedEventArgs e)
        {
            DataStructure.Thread tappedThread = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.Thread;

            if (tappedThread != null)
            {
                if (_currentThread != null && tappedThread.threadId == _currentThread.threadId && replyStackPanel.Visibility == Visibility.Visible)
                {
                    replyStackPanel.Visibility = Visibility.Collapsed;
                }
                else
                {
                    _isToPostNewThread = false;
                    _currentThread = tappedThread;
                    replyStackPanel.Visibility = Visibility.Visible;
                    titleTextBox.Text = "Re: " + tappedThread.threadTitle;
                    contentTextBox.Text = "";
                }
            }
        }
コード例 #2
0
        private void thread_Tapped(object sender, TappedRoutedEventArgs e)
        {
            DataStructure.PostTitle selectedPostTitle = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.PostTitle;

            if (selectedPostTitle != null)
            {
                if (selectedPostTitle.isPostHeading)
                {
                    _isToPostNewThread = true;
                    _headingId = selectedPostTitle.headingId;
                    replyStackPanel.Visibility = Visibility.Visible;
                    titleTextBox.Text = "";
                    contentTextBox.Text = "";
                }
                else
                {
                    // openning an existing thread
                    foreach (DataStructure.Heading heading in _currentModule.moduleForums[_currentForumIndex].forumHeadings)
                    {
                        foreach (DataStructure.Thread thread in heading.headingThreads)
                        {
                            if (thread.threadId == selectedPostTitle.threadId)
                            {
                                _currentBaseThread = thread;
                                threads.Source = _currentBaseThread.threadAllThreads;
                                return;
                            }
                        }
                    }
                }
            }
        }