根據demo實現不規則宮格佈局的時候發現設置行列的時候不起作用。
VariableSizedWrapGrid.SetRowSpan(element as ContentControl, rowVal);
VariableSizedWrapGrid.SetColumnSpan(element as ContentControl, colVal);
原因如下:沒有設置VariableSizedWrapGrid的ItemHeight , ItemWidth (Demo裏面沒有設置)。
<local:CustomGridView.ItemsPanel>
<ItemsPanelTemplate>
<VariableSizedWrapGrid ItemHeight="260" ItemWidth="260"/>
</ItemsPanelTemplate>
</local:CustomGridView.ItemsPanel>