9
私はdataTemplate
を使用しています。これはテンプレートです:マルチバインディングで親値を取得する方法
<ItemsControl ItemsSource="{Binding RAM.Partitions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Position, StringFormat={}{0}k}"/>
<Grid Grid.Column="1">
<Border>
<Border.Height>
<MultiBinding Converter="{StaticResource MultiplyConverter}">
<Binding ElementName="LayoutRoot" Path="ActualHeight"/>
<Binding Path="Size" />
<Binding Path="RAM.Size" />
</MultiBinding>
</Border.Height>
</Border>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
この行が表示されますか?ラインは私に例外をスローRAM.Size
が親要素からなので、それはすべきであると
<Binding Path="RAM.Size" />
。その価値をどのように得ることができますか?
ありがとうございます!
ありがとうございます、これは私のプロジェクトでうまくいっています! –