I need to implement the gluing objects to each other.
If the objects intersect the borders. attach to each other.
the objects intersect the borders

the objects attached

or it must implement code ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Code will have to feature but how much can vary. Personally I’d use more code in this case.
I’d conceptually separate the red rectangles from the green borders. The red retangle represents a single item that may or may not be attached to another. The green borders will contain a horizontally oriented
StackPaneland represents a set of items that are attached to each other.Initially no item is attached to any other hence the all existing in there own green border representing an attached item groups all having only one member.
When you “attach” an item to another the red rectangle representing one of the items is removed from its existing stackpanel and added to the stackpanel contain the other. The now empty green border is removed from view.