/// <summary> /// The on Attached event Handler /// </summary> protected override void OnAttached() { base.OnAttached(); this.viewModel = (IDiagramPortViewModel)this.AssociatedObject.DataContext; this.viewModel.WhenPositionIsUpdated += this.WhenPositionIsUpdated; this.DeterminePortConnectorRotation(); }
/// <summary> /// Initializes a new instance of the <see cref="DiagramPortShape"/> class. /// </summary> /// <param name="datacontext"/> /// The <see cref="IDiagramPortViewModel"/> data-context public DiagramPortShape(IDiagramPortViewModel datacontext) { this.DataContext = datacontext; this.InitializeComponent(); }