PriorityBinding.Bindings Property

 

Gets the collection of Binding objects that is established for this instance of PriorityBinding.

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

public Collection<BindingBase> Bindings { get; }

Property Value

Type: System.Collections.ObjectModel.Collection<BindingBase>

A collection of Binding objects. PriorityBinding currently supports only objects of type Binding and not MultiBinding or PriorityBinding. Adding a Binding child to a PriorityBinding object implicitly adds the child to the BindingBase collection for the MultiBinding object. The default is an empty collection.

System_CAPS_noteNote

This property can only be set in Extensible Application Markup Language (XAML) by using the collection syntax that is shown in the following example, or by accessing the collection object and using its various methods, such as Add. The property that you use to access the collection object is read-only, whereas the collection itself is read/write.

<object>
    OneOrMoreBindings
</object>

OneOrMoreBindings

One or more Binding objects; PriorityBinding does not currently support MultiBinding or PriorityBinding objects.

In the following example, <PriorityBinding.Bindings> is implicit. The Binding objects that are established for the PriorityBinding are implicitly added to the BindingBase collection. For more information, see the "Property Value" section earlier in this topic.

<Window.Resources>
  <c:AsyncDataSource SlowestDP="Slowest Value" SlowerDP="Slower Value"
                     FastDP="Fast Value" x:Key="AsyncDS" />
</Window.Resources>

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
  DataContext="{Binding Source={StaticResource AsyncDS}}">
  <TextBlock FontSize="18" FontWeight="Bold" Margin="10"
    HorizontalAlignment="Center">Priority Binding</TextBlock>
  <TextBlock Background="Honeydew" Width="100" HorizontalAlignment="Center">
    <TextBlock.Text>
      <PriorityBinding FallbackValue="defaultvalue">
        <Binding Path="SlowestDP" IsAsync="True"/>
        <Binding Path="SlowerDP" IsAsync="True"/>
        <Binding Path="FastDP" />
      </PriorityBinding>
    </TextBlock.Text>
  </TextBlock>	
</StackPanel>

.NET Framework
Available since 3.0
Return to top
Show: