I want to make a grid with wrap panel behavior and resizable control inside it, how can I do this?
maybe it’s easier to show what I want in images :
initial state:

resize control 1 with direction bottom-right so it will take around 2×2 cells, then control 2 and so on will rearrange it’s position on the grid:

when it’s resized back it should be back to initial state.
You would just need to create a class that extends
Panelto create the animations. Here is a very good article on how to create an animatedWrapPanel. Then, you would need to create aDataTemplatefor your items that usesTriggers to grow and shrink each one. This could also be animated in theTrigger. ThePanelwould automatically move the other items around as the item changes size… dependent on the code you put in yourPanel.ArrangeOverridemethod.You would need to create a data type (class) to use as your items (squares). This class would need a string property to store the box number and a
boolIsLargeproperty to let the UI know whether to display it large or not. I haven’t actually tried this code, but you could use something like this for yourDataTemplate:Then you associate the
DataTemplatewith eachListBoxItemlike this:I haven’t defined any
SelectedBoxTemplateDataTemplate, but you could declare a different one that would get activated using theStyle.Trigger.Then finally, you would declare your
ListBoxsomething like this: