コード例 #1
0
        /// <summary>
        /// Sets the position of the item in the parent canvas.
        /// </summary>
        /// <param name="pPos">The container position.</param>
        public void SetCanvasPosition(Point pPos)
        {
            GraphItemContainer lParentGraphItem = this.FindVisualParent <GraphItemContainer>();

            if (lParentGraphItem != null)
            {
                lParentGraphItem.PosX = pPos.X;
                lParentGraphItem.PosY = pPos.Y;
            }
        }
コード例 #2
0
        /// <summary>
        /// Returns the node view containing the given view model.
        /// </summary>
        /// <param name="pItem">The item contained by the view.</param>
        /// <returns>The found view if any, null otherwise.</returns>
        public AGraphItem GetContainerForViewModel(IGraphItemViewModel pItem)
        {
            GraphItemContainer lItemView = this.ItemContainerGenerator.ContainerFromItem(pItem) as GraphItemContainer;

            if (lItemView != null)
            {
                return(lItemView.TemplateControl);
            }

            return(null);
        }
コード例 #3
0
        /// <summary>
        /// Gets the position of the item in the parent canvas.
        /// </summary>
        /// <returns>The position of the item in the parent canvas.</returns>
        public Point?GetCanvasPosition()
        {
            GraphItemContainer lParentGraphItem = this.FindVisualParent <GraphItemContainer>();

            if (lParentGraphItem != null)
            {
                return(new Point(lParentGraphItem.PosX, lParentGraphItem.PosY));
            }

            return(null);
        }