wpf - Irregular layout ItemsControl -


itemprop = "text">

I have a strange layout for an ItemsControl

I have a 4x6 grid with the following pattern. :

  1 2 3 4 13 14 15 16 5 6 7 8 17 18 19 20 9 10 11 12 21 22 23 24 What is an easy way Is it to do? Should I use 6 item controls and take "section" in my list? Is there a good way to do this? What about notification?  

It is important to note that I can present all 24 entries, but the layout should be maintained (it looks like a Bingo card or something full of things).

Edit:

Ideally, I want to be able to take a list, and want to enjoy some sort of item sorting / padding type of items in the list. For example, if I have an observation compilation with some units, and the unit has an "index" property, then I want to create a visual consumable collection that automatically indexes Uses to create padded list. I think a noticeable dictionary can work, but it looks gross. Maybe a new custom layout is in the order of the panel?

After

A clever way of doing this in pure XAML is to use a custom template to control your items. This is the easiest, so all your "cards" have a fixed size, say 100x100:

   & Lt ;! - items 13 to 24 - & gt; & Lt; ItemsControl ItemsSource = "{TemplateBinding ItemsSource}" ItemsPanel = "{StaticResource WrapPanelTemplate}" ItemTemplate = "{StaticResource ItemInDoubleHighBox}" RenderTransform = "1 0 1 0 -500" /> & Lt; / Grid & gt; & Lt; / ControlTemplate & gt;  

How it works: With the DataTemplate as well as 1-12 visible "double distance", the item causes the item, and the RenderTransform is item 13-24 on the itemsControl, Whatever makes it "double-space" appears in the space between the first rows of objects.

Note: You can make the height and width data-binding, but it takes more XML than just add "200", "500", or "600" scale transforms everywhere in XAML. For example, to deal with "200" you can scale scale on internal decorator with scale Y = "0.5" and control each item with scale Y = "2". Now the height of the outer decorator is 100, which can be data-bound. Other constants can be dealt with by pre and post scaling similar to content. And because WPF adds all the changes before rendering in any way, additional changes will not basically cost anything.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -