This question is locked. New answers and comments are not allowed.
In ScheduleView I use a Tooltip template with a couple of converters to show the “Staff” and “Company” resources when someone hovers over the appointment.
If I update the Resource in the appointment the tooltip still shows the original resource not the new value, the converter doesn’t get triggered.
I assume this is a binding problem with the Appointment.Resources collection?
Is this by design? If so is there a workaround?
Tooltip:
<DataTemplate x:Key="ToolTipTemplate"> <StackPanel> <TextBlock FontWeight="Bold" FontSize="12" Text="{Binding Appointment.Subject}"/> <TextBlock Text="{Binding Category, Mode=OneWay, Converter={StaticResource ScheduleCategoryConverter}}"/> <StackPanel Orientation="Horizontal"> <TextBlock Text="Staff: "/> <TextBlock Text="{Binding Appointment.Resources, Mode=OneWay, Converter={StaticResource ScheduleResourceStaffConverter}}"/> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Company: "/> <TextBlock Text="{Binding Appointment.Resources, Mode=OneWay, Converter={StaticResource ScheduleResourceCompanyConverter}}"/> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Appointment.Start, Mode=OneWay, StringFormat=h:mm tt}"/> <TextBlock Text=" - "/> <TextBlock Text="{Binding Appointment.End, Mode=OneWay, StringFormat=h:mm tt}"/> </StackPanel> </StackPanel> </DataTemplate>Converter:
public class ScheduleResourceCompanyConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string strToRet = "None"; if (value != null) { ResourceCollection Res = (ResourceCollection)value; foreach (Resource res in Res) { if (res.ResourceType == "Company") strToRet = res.DisplayName; } } return strToRet; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return null; } }