private void PollResponseButtons_Click(object sender, EventArgs e)
        {
            Button       button  = sender as Button;
            ItemsControl listbox = ConversationMessagesView.FindParent <ItemsControl>(button);
            MessageModel message = ((MessageModel)listbox.DataContext);

            if (button != null)
            {
                string calendarOption = button.Content.ToString();
                try
                {
                    if (message.IsCalendarMessage && string.Compare(button.Content.ToString(), Strings.CalendarAddOption, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        calendarOption = MessageModel.CalendarAcceptStringNonLocalized;
                        this.AddAppointmentToCalendar(message.AppointmentDateTime.Value, message.AppointmentDuration.Value, ((MessageModel)listbox.DataContext).TextMessage);
                    }
                    else if (message.IsCalendarMessage && string.Compare(button.Content.ToString(), Strings.CalendarDeclineOption, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        calendarOption = MessageModel.CalendarDeclineStringNonLocalized;
                    }
                }
                catch (Exception)
                {
                }

                // For calendar messages, the localized strings are only for display.
                // When responses are sent over the wire, hard coded strings are sent
                // This is because the sender's language and the recipient's language might be different
                this.PostPollResponse(((MessageModel)listbox.DataContext).MessageId, ((MessageModel)listbox.DataContext).ClientMessageId, calendarOption);
            }
        }
        private void SeeTaskButton_Click(object sender, EventArgs e)
        {
            Button       button  = sender as Button;
            Grid         listbox = ConversationMessagesView.FindParent <Grid>(button);
            MessageModel message = ((MessageModel)listbox.DataContext);

            if (message.TaskId.HasValue && message.TaskId.Value != Guid.Empty)
            {
                NavigationService.Navigate(new Uri(string.Format("/Views/Tasklist.xaml?clientmessageid={0}", message.TaskId.Value), UriKind.Relative));
            }
        }