I’m currently adding custom label controls dynamically at runtime in my WPF app.
I’ve got a WrapPanel wrapping the contents of the labels if needed(contents are set dynamically).
Everything works fine, but I want to “unwrap” the label.
The premise is that you can click and drag this label elsewhere on the screen (drag and drop functionality isn’t the issue here) which is a much larger area and therefore should only occupy one line.
What would be the best way to achieve this sort of functionality?
The simplest way to go about this is to use an ItemsControl for your dynamic list and change its ItemsPanelTemplate on the fly. Here is full working code I just made…
MainWindow.xaml:
MainWindow.xaml.cs:
Hope this helps!