There is a concept of Multibinding
in WPF
, which is really useful if we want to bind some UI Control that depends on multiple values, like in this one.
I am trying to do the same with ProgressBar
, like I am using ProgressBar
to display how much storage is used by the users and it depends on two properties.
- UsedStorage
- TotalStorage
After searching, i could not find a way to bind Value
property of ProgressBar
with multiple properties and custom convertor.
Something like (Just a concept)
<ProgressBar Width="172" Height="16" >
<ProgressBar.Value>
<MultiBinding Converter="{StaticResource myConverter}">
<Binding Path="UsedStorage" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
<Binding Path="TotalStorage" RelativeSource="{RelativeSource AncestorType={x:Type Window}}"/>
</MultiBinding>
</ProgressBar.Value>
</ProgressBar>
But problem is there is nothing like MultiBinding
under ProgressBar.Value
. So the question is,
Is there a way to MultiBind
ProgressBar
Value
?