Appointment item content problem

1 posts, 0 answers
  1. PaulH
    PaulH avatar
    40 posts
    Member since:
    Mar 2011

    Posted 19 Sep 2011 Link to this post

    Hi there

    A prospective customer is insisting that the appointment items and their tooltips show not just the subject but the body of the appointment as well. I have been able to make the tooltip display correctly by simply changing it to display a stack panel with textblocks for the subject and body inside. I want to retain the text wrapping functionality of the appointment item content textblock which I would lose if I repeated the same steps for the appointment item content template. I have tried creating a value converter which will amalgamate the subject and body for me and display that in the appointment item but this seems to have the effect of changing all appointments to display with the same text showing on them. Is there a way you can see of achieving the desired result?
    Thanks in advance

    My AppointmentItem DataTemplate:

     

    <DataTemplate x:Key="AppointmentItemTemplate">

    <TextBlock Text="{Binding Converter={StaticResource AppointmentItemValueConverter}}" TextWrapping="Wrap" TextTrimming="WordEllipsis" />

     

    </DataTemplate>


    My converter (Convert method):

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)

    {

     

    if (null == value) return string.Empty;

    AppointmentItemProxy itemProxy = (AppointmentItemProxy)value;

    Appointment appointment = (Appointment)itemProxy.Appointment;

    return string.Format(System.Globalization.CultureInfo.CurrentUICulture, "{0}\r{1}", appointment.Subject, appointment.Body);

    }

Back to Top