Hi,
I've created a custom appointment just like this tutorial demonstrates.
Everything works fine, but now I'm trying to apply a style trigger to an appointmentiotemcontenttemplate:
In two instances here I'm trying to use the ProductCategory property, and it won't work. If I were to change the trigger to use the 'Subject' property of the appointments I am dragging (from a listbox I should add) onto the ScheduleView it works without a problem. Likewise, the textblock that attempts to display the ProductCategory does not work, whereas the 'Subject' does. It seems that any additional fields I have added to the Job.cs (custom appointment) are not accessible!? The syntax (private/get/set) is exactly the same as the tutorial so I can't understand it?
Thanks a LOT for any help in advance!
I've created a custom appointment just like this tutorial demonstrates.
Everything works fine, but now I'm trying to apply a style trigger to an appointmentiotemcontenttemplate:
<DataTemplate x:Key="AppointmentItemContentTemplate"> <Grid> <Border> <Border.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding ProductCategory}" Value="Building"> <Setter Property="Border.Background" Value="CornflowerBlue"></Setter> </DataTrigger> </Style.Triggers> </Style> </Border.Style> <Grid> <TextBlock Margin="8,2" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="{Binding Subject}" Grid.Column="1" /> <TextBlock Margin="8,2" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="{Binding ProductCategory}" Grid.Column="1" /> </Grid> </Border> </Grid> </DataTemplate>
In two instances here I'm trying to use the ProductCategory property, and it won't work. If I were to change the trigger to use the 'Subject' property of the appointments I am dragging (from a listbox I should add) onto the ScheduleView it works without a problem. Likewise, the textblock that attempts to display the ProductCategory does not work, whereas the 'Subject' does. It seems that any additional fields I have added to the Job.cs (custom appointment) are not accessible!? The syntax (private/get/set) is exactly the same as the tutorial so I can't understand it?
Thanks a LOT for any help in advance!