One my idea is: create two separate controls representing two parts loosely coupled together. One control should use an interface of another control. In this way, you solve your layout problem separately from controls functionality.
Let's consider Top part uses interface of Button part (you can flip it; I don't know your functionality:
public interface IBottomControl { }
public class BottomControl : IBottomControl { }
public class TopControl {
public IBottomControl BottomControl { get; set; }
}
TopControl MyTopControl = new TopControl();
BottomControl MyBottomControl = new BottomControl();
MyTopControl.BottomControl = MyBottomControl;
Can it fit your control functionality? (You did not share any information on it, so I cannot know exactly.)
It's important to understand
loose coupling. Read
http://en.wikipedia.org/wiki/Loose_coupling[
^].
Here is another idea:
I found that layout problems are solved much better when you don't use Grid but use
DockPanel
instead. See:
http://msdn.microsoft.com/en-us/library/system.windows.controls.dockpanel.aspx[
^],
http://www.wpftutorial.net/DockPanel.html[
^].
—SA