I originally posted this on StackOverflow, but got the message that this was the correct forum for such a question. https://stackoverflow.com/questions/44077183/wpf-arrangable-row-of-rectangles.
I am in the process of creating a small application which has the task of visualizing sorting algorithms. I am using the MVVM pattern. It does this by first displaying a row of rectangles, each with a number to be sorted by (left out in illustration). Here's a quick draft:
So, the application will show each step in the algorithm by physically moving the rectangles. In the illustration above, the third rectangle is switching place with the second. My plan was to have some sort of rectangle class, and then putting these in an ObservableCollection and then run the algorithm on them – seems simple enough, but the problem is the movement of the rectangles, and the fact that they should be animated (by position) and moved physically out of the list for a second before being put back in again. Does anybody have a good approach here?