我想知道如何将我的转换器分配给ConvertPoint
祖先中调用的成员Viewport
?
<DataTemplate DataType="{x:Type local:TestShape}">
<DataTemplate.Resources>
<RelativeSource AncestorType="{x:Type root:Viewport}" x:Key="Viewport"/>
<root:BezierScaleConvertor x:Key="BezierScaleConvertor" />
</DataTemplate.Resources>
<control:TestShape>
<control:TestShape.StartPoint>
<MultiBinding Converter="???"> <----------- Here I don't know how to refer to the member ConvertPoint which is a convertor in Viewport, if I use dynamicResource or Binding, it will raise an exception because it's not a DP.
<Binding Path="StartPoint" />
<Binding Path="ScaleX" RelativeSource="{StaticResource Viewport}"/>
<Binding Path="ScaleY" RelativeSource="{StaticResource Viewport}" />
</MultiBinding>
</control:TestShape.StartPoint>
<control:TestShape.Segments>
<MultiBinding Converter="{StaticResource BezierScaleConvertor}">
<Binding Path="Segments" />
<Binding Path="ScaleX" RelativeSource="{StaticResource Viewport}" />
<Binding Path="ScaleY" RelativeSource="{StaticResource Viewport}" />
</MultiBinding>
</control:TestShape.Segments>
</control:TestShape>
</DataTemplate>