|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
RelativeSource-Klasse
Namespace: System.Windows.Data
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS für XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Der RelativeSource-Typ macht die folgenden Member verfügbar.
| Name | Beschreibung | |
|---|---|---|
![]() | RelativeSource() | |
![]() | RelativeSource(RelativeSourceMode) | |
![]() | RelativeSource(RelativeSourceMode, Type, Int32) |
| Name | Beschreibung | |
|---|---|---|
![]() | AncestorLevel | |
![]() | AncestorType | |
![]() | Mode | |
![]() ![]() | PreviousData | |
![]() ![]() | Self | |
![]() ![]() | TemplatedParent |
| Name | Beschreibung | |
|---|---|---|
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | MemberwiseClone | |
![]() | ProvideValue | |
![]() | ShouldSerializeAncestorLevel | |
![]() | ShouldSerializeAncestorType | |
![]() | ToString |
| Name | Beschreibung | |
|---|---|---|
![]() ![]() | ISupportInitialize.BeginInit | |
![]() ![]() | ISupportInitialize.EndInit |
<Style x:Key="textBoxInError" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style>
<!--ControlTemplate for NumericUpDown that inherits from Control.--> <Style TargetType="{x:Type local:NumericUpDown}"> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:NumericUpDown}"> <Grid Margin="3"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Border BorderThickness="1" BorderBrush="Gray" Margin="2" Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Stretch"> <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}" Width="60" TextAlignment="Right" Padding="5"/> </Border> <RepeatButton Command="{x:Static local:NumericUpDown.IncreaseCommand}" Grid.Column="1" Grid.Row="0">Up</RepeatButton> <RepeatButton Command="{x:Static local:NumericUpDown.DecreaseCommand}" Grid.Column="1" Grid.Row="1">Down</RepeatButton> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
Dim myBinding As New Binding() ' Returns the second ItemsControl encountered on the upward path ' starting at the target element of the binding myBinding.RelativeSource = New RelativeSource(RelativeSourceMode.FindAncestor, GetType(ItemsControl), 2)
Binding myBinding = new Binding(); // Returns the second ItemsControl encountered on the upward path // starting at the target element of the binding myBinding.RelativeSource = new RelativeSource( RelativeSourceMode.FindAncestor, typeof(ItemsControl), 2);
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
