I've added a "CapacityBar" to the TimeRulerItem as seen in the attached image. The text and progress bar are supposed to show how full each day is based on the currently displayed appointments. As seen in the image, this does currently work the first time the view is displayed. When the user makes a change that causes the AppointmentFilter to show different appointments, the capacity bar is not updated.
Here's how I added the capacity bar:
How can I get the capacity bar to refresh? I've tried doing an OnPropertyChange(null) in my ViewModel to get all properties to update, but since this doesn't really seem bound to any specific property directly, that doesn't work. Is there a better way of doing this binding? How can I get this to work the way I'd like?
I'm sorry if this is a general WPF binding question instead of specific to telerik, but it had enough telerik details that I didn't think it was appropriate for a generic WPF forum.
Thank you!
Here's how I added the capacity bar:
<
telerikScheduleView:TimeRulerItemTemplateSelector.MonthItemTemplate
>
<
DataTemplate
>
<
DataTemplate.Resources
>
<
converters:DateToCapacityBarCountConverter
x:Key
=
"DateToCapacityBarCountConverter"
/>
<
converters:DateToCapacityBarPercentConverter
x:Key
=
"DateToCapacityBarPercentConverter"
/>
<
converters:DateToCapacityBarVisibleConverter
x:Key
=
"DateToCapacityBarVisibleConverter"
/>
</
DataTemplate.Resources
>
<
Grid
Margin
=
"6 2"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"*"
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
TextBlock
Text
=
"{Binding FormattedValue}"
Grid.Row
=
"0"
Grid.Column
=
"0"
/>
<
Grid
Margin
=
"6 2"
HorizontalAlignment
=
"Stretch"
Grid.Row
=
"0"
Grid.Column
=
"1"
>
<
Grid.Visibility
>
<
MultiBinding
Converter
=
"{StaticResource DateToCapacityBarVisibleConverter}"
>
<
Binding
Path
=
"DateTime"
Mode
=
"OneWay"
/>
<
Binding
Path
=
"DataContext"
RelativeSource
=
"{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}"
/>
</
MultiBinding
>
</
Grid.Visibility
>
<
telerik:RadProgressBar
Minimum
=
"0"
Maximum
=
"100"
>
<
telerik:RadProgressBar.Value
>
<
MultiBinding
Converter
=
"{StaticResource DateToCapacityBarPercentConverter}"
>
<
Binding
Path
=
"DateTime"
Mode
=
"OneWay"
/>
<
Binding
Path
=
"DataContext"
RelativeSource
=
"{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}"
UpdateSourceTrigger
=
"PropertyChanged"
/>
</
MultiBinding
>
</
telerik:RadProgressBar.Value
>
</
telerik:RadProgressBar
>
<
TextBlock
Margin
=
"0"
HorizontalAlignment
=
"Center"
>
<
TextBlock.Text
>
<
MultiBinding
Converter
=
"{StaticResource DateToCapacityBarCountConverter}"
>
<
Binding
Path
=
"DateTime"
/>
<
Binding
Path
=
"DataContext"
RelativeSource
=
"{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}"
UpdateSourceTrigger
=
"PropertyChanged"
/>
</
MultiBinding
>
</
TextBlock.Text
>
</
TextBlock
>
</
Grid
>
</
Grid
>
</
DataTemplate
>
</
telerikScheduleView:TimeRulerItemTemplateSelector.MonthItemTemplate
>
How can I get the capacity bar to refresh? I've tried doing an OnPropertyChange(null) in my ViewModel to get all properties to update, but since this doesn't really seem bound to any specific property directly, that doesn't work. Is there a better way of doing this binding? How can I get this to work the way I'd like?
I'm sorry if this is a general WPF binding question instead of specific to telerik, but it had enough telerik details that I didn't think it was appropriate for a generic WPF forum.
Thank you!