1

Path.Data(Path here is )で動作する 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>

何を試しても、常にコンパイルエラーが発生しました。

4

2 に答える 2

3

プロパティをバインドし、PathGeometry.Figuresを返すコンバーターを用意するPathFigureCollectionこともできますが、残念ながら、VS Designer が 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-20T11:06:10.007 に答える
-1

PathGeometry タグの代わりにバインディング コードを配置してみることができます

<Path.Data>                    
    <MultiBinding Converter="{StaticResource ResourceKey=ToPathGeometryMultiConverter}">
       <Binding Path="A"/>
       <Binding Path="B"/>
       <Binding Path="C"/>
    </MultiBinding>  
<Path.Data>
于 2013-02-20T08:55:41.737 に答える