แก้ไข

แชร์ผ่าน


PriorityBinding.Bindings Property

Definition

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

public:
 property System::Collections::ObjectModel::Collection<System::Windows::Data::BindingBase ^> ^ Bindings { System::Collections::ObjectModel::Collection<System::Windows::Data::BindingBase ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.Windows.Data.BindingBase> Bindings { get; }
member this.Bindings : System.Collections.ObjectModel.Collection<System.Windows.Data.BindingBase>
Public ReadOnly Property Bindings As Collection(Of BindingBase)

Property Value

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.

Examples

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>

Remarks

Note

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.

XAML Property Element Usage

<object>  
    OneOrMoreBindings  
</object>  

XAML Values

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

Applies to