我有一个带Path.Data的工作MultiBinding (这里的路径是System.Windows.Shapes.Path)。转换器返回类型为System.Windows.Media.PathGeometry。
<Path.Data>
<MultiBinding Converter="{StaticResource ResourceKey=ToPathGeometryMultiConverter}">
<Binding Path="A"/>
<Binding Path="B"/>
<Binding Path="C"/>
</MultiBinding>-->
</Path.Data>现在我想稍微改变一下结构,并在GeometryGroup中添加几个几何图形。我不知道如何在这里添加MultiBinding的语法。
<Path.Data>
<GeometryGroup>
<PathGeometry>
<!-- HOW CAN I MULTIBIND HERE -->
</PathGeometry>
</GeometryGrounp>
<Path.Data>无论我怎么尝试,我总是得到一个编译错误。
发布于 2013-02-20 19:06:10
您可以绑定PathGeometry.Figures属性并拥有一个返回PathFigureCollection的转换器,但我担心您必须接受VS设计器抱怨XAML的事实。
<Path.Data>
<GeometryGroup>
<PathGeometry>
<PathGeometry.Figures>
<MultiBinding Converter="{StaticResource PathFiguresConverter}">
<Binding Path="A"/>
<Binding Path="B"/>
<Binding Path="C"/>
</MultiBinding>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>发布于 2013-02-20 16:55:42
您可以尝试将绑定代码而不是PathGeometry标记
<Path.Data>
<MultiBinding Converter="{StaticResource ResourceKey=ToPathGeometryMultiConverter}">
<Binding Path="A"/>
<Binding Path="B"/>
<Binding Path="C"/>
</MultiBinding>
<Path.Data>https://stackoverflow.com/questions/14975574
复制相似问题