Example #1
0
        //In Node drop event, setting width and height of the dropped node
        void diagramView_NodeDrop(object sender, NodeDroppedRoutedEventArgs evtArgs)
        {
            Node droppednode = evtArgs.DroppedNode as Node;

            if (evtArgs.SymbolPaletteItemName == "NodeId")
            {
                droppednode.Label  = "Id";
                droppednode.Height = 25;
                droppednode.Width  = 40;
            }
            else if (evtArgs.SymbolPaletteItemName == "Ellipse")
            {
                droppednode.Height     = 70;
                droppednode.Width      = 175;
                droppednode.LabelWidth = 75;
            }
            else if (evtArgs.SymbolPaletteItemName == "Arrow")
            {
                droppednode.Height = 15;
                droppednode.Width  = 200;
            }
        }
Example #2
0
        //Nodedropp event fro Identifing the DroppedNode
        void diagramView_NodeDrop(object sender, NodeDroppedRoutedEventArgs evtArgs)
        {
            Node n1 = evtArgs.Source as Node;

            if (evtArgs.SymbolPaletteItemName == "Employee")
            {
                Node n2 = evtArgs.DroppedNode as Node;
                n2.Tag = "ceo";
                n2.Loaded += new RoutedEventHandler(node_Loaded);
            }

            if (evtArgs.SymbolPaletteItemName == "Man")
            {
                Node n3 = evtArgs.DroppedNode as Node;
                n3.Tag = "boy";
                n3.Loaded += new RoutedEventHandler(node_Loaded);
            }
            if (evtArgs.SymbolPaletteItemName == "Lady")
            {
                Node n4 = evtArgs.DroppedNode as Node;
                n4.Tag = "lady";
                n4.Loaded += new RoutedEventHandler(node_Loaded);
            }
        }
Example #3
0
 void diagramView_NodeDrop(object sender, NodeDroppedRoutedEventArgs evtArgs)
 {
     (evtArgs.DroppedNode as Node).LabelHorizontalAlignment = HorizontalAlignment.Center;
     (evtArgs.DroppedNode as Node).LabelVerticalAlignment   = VerticalAlignment.Center;
 }