PriorityBinding.Bindings Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기