バインディング ターゲットの位置に対して相対的な位置を指定することにより、バインディング ソースを取得または設定します。
Self †自身の別のプロパティを参照できます。 下記の例で、コントロールのTooltip中に自身の「Text」の値を表示する <TextBlock Text="TextBlock" ToolTipService.ToolTip="{Binding Text, RelativeSource={RelativeSource Self}}" HorizontalAlignment="Center" VerticalAlignment="Center"/> TemplatedParent †ControlTemplate が適用されるコントロールでは、バインディングの検証エラー情報をテンプレート レベルで適用する場合に便利です。 下記の例では、ControlTemplateの中に、TargetTypeで指定したテンプレートの親のコントロールのプロパティをバインディングする <Style TargetType="local:customSlider"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:customSlider"> <TextBox Width="200" Text="{Binding Path=Value, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> iディレクトリで複数のポータルサイトにディレクトリ登録 コメント: |