Let's perform the following steps to create a few elements inside a window and provide the option to drag and drop from one panel to the other:
- First, open MainWindow.xaml and replace the existing Grid with a StackPanel. Set its Orientation property to Horizontal.
- Add two WrapPanel inside it and set their Width, Margin, ItemHeight, and ItemWidth properties.
- Give a name to both panels. Let's name the first wrap panel sourcePanel and the second wrap panel targetPanel. We will be using these name later from the code, while accessing them.
- Add a few labels to the first wrap panel. Set their Content, Background, and other text formatting properties. Here's the complete markup code:
<StackPanel Orientation="Horizontal"> <WrapPanel x:Name="sourcePanel" ItemHeight="60" ItemWidth="100" Width="200" Margin="4" Background="LightGoldenrodYellow...