public SequenceDiagramColumnView(SequenceDiagramView parent, PartyViewModel partyVM) { this.CanBeFocused = false; // Create the party view and add it to this column view. PartyView = new PartyView { ViewModel = partyVM }; AnchorsProperty.SetValue(PartyView, Anchors.Left | Anchors.Top | Anchors.Right); Children.Add(PartyView); // Create the lifeline view and add it to this column view. LifeLineView = new LifeLineView(); MarginsProperty.SetValue(LifeLineView, new Margins(0, PartyView.PreferredHeight + 10, 0, 0)); Children.Add(LifeLineView); // Set up viewmodel subscription. parent.ViewModelChanged.Select(vm => vm.StackVM) .Subscribe(stackVM => LifeLineView.ViewModel = stackVM.CreateLifeLineForParty(partyVM)); }
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); }