sma6871
sma6871

Reputation: 3298

Windows 8 Metro style listbox

I'm building a wpf metro style application, but for the start, page I needed to create Windows 8 start screen like listbox in windows 7 and .NetFramework 4.0.

I used Listbox and Wrappanel now, but as you see it's not clear!!!

enter image description here

Please help me to fill the blank cell.

EDIT change place of buttons enter image description here

Upvotes: 6

Views: 6541

Answers (4)

Nicolas Voron
Nicolas Voron

Reputation: 2996

VariableSizeWrapGrid does the trick :

<GridView>
  <GridView.ItemsPanel>
    <ItemsPanelTemplate>
      <VariableSizeWrapGrid ItemHeight="100" ItemWidth="150"/>
    </ItemsPanelTemplate>
  </GridView.ItemsPanel>   
</GridView>

Example of result :

enter image description here

Upvotes: 1

varholl
varholl

Reputation: 331

this is not trivial at all... even microsoft guys told me that on a recent training I had..

I recommend following the following article which has something very close to what you need!

http://tozon.info/blog/post/2012/09/01/Variable-sized-grid-items-in-Windows-8-apps.aspx

Hope it helps!

Upvotes: 2

Arnaud Weil
Arnaud Weil

Reputation: 2492

Use a WrapPanel for layout and you're done:

<ListBox>
  ...
  <ListBox.ItemsPanel>
    <ItemsPanelTemplate>
      <WrapPanel />
    </ItemsPanelTemplate>
  </ListBox.ItemsPanel>
</ListBox>

Upvotes: 0

Related Questions