セッター値をプロパティにバインドしようとしていますが、壊滅的なエラー 0x8000ffff が発生し続けます
これを試しました:
<ItemsControl.Style>
<Style TargetType="ContentPresenter">
<Setter Property="Grid.Row"
Value="{Binding GridRow}" />
<Setter Property="Grid.Column"
Value="{Binding GridColumn}" />
</Style>
</ItemsControl.Style>
次に、これ:
<ItemsControl.Style>
<Style TargetType="ContentPresenter">
<Setter Property="Grid.Row"
Value="0" />
<Setter Property="Grid.Column"
Value="0" />
</Style>
</ItemsControl.Style>
TargetType を取得するには、SL5 にアップグレードする必要がありました。2 番目の例では、バインドの試みをすべて削除しますが、それでも「壊滅的に」失敗します。
<ItemsControl.ItemsPanel> <ItemsPanelTemplate> <layout:MatrixGrid /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel>
グリッドにデータのマトリックスを作成しようとしています(他の誰かの例で説明されているように)。
ItemsControl (Silverlight) には ItemContainerStyle 要素がないため、これを試していますが、これまでのところうまくいきません。
<ListBox.ItemsPanel> <ItemsPanelTemplate> <layout:MatrixGrid /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemContainerStyle> <Style TargetType="ContentPresenter"> <Setter Property="Grid.Row" Value="{Binding GridRow}" /> <Setter Property="Grid.Column" Value="{Binding GridColumn}" /> </Style> </ListBox.ItemContainerStyle>