public CommunicationDiagramPartyView() { // Set layout MarginsProperty.SetValue(LeftArrowStack, new Margins(Width / 3, 0, 0, 0)); MarginsProperty.SetValue(RightArrowStack, new Margins(0, 0, Width / 3, 0)); AnchorsProperty.SetValue(LeftArrowStack, Anchors.Bottom | Anchors.Top | Anchors.Left); AnchorsProperty.SetValue(RightArrowStack, Anchors.Bottom | Anchors.Top | Anchors.Right); //Set the arrow stack size; LeftArrowStack.PreferredWidth = 3; RightArrowStack.PreferredWidth = 3; // Change the margin size on a change of width. WidthChanged.Subscribe(newWidth => { MarginsProperty.SetValue(LeftArrowStack, new Margins(newWidth / 4, 0, 0, 0)); MarginsProperty.SetValue(RightArrowStack, new Margins(0, 0, newWidth / 4, 0)); }); Children.Add(LeftArrowStack); Children.Add(RightArrowStack); }