public ActivityDiagramPage()
        {
            InitializeComponent();
            Application.Current.MainWindow.Width  = 1000;
            Application.Current.MainWindow.Height = 600;
            var model = new GraphLinksModel <ActivityDiagramNodeData, String, String, ActivityDiagramLinkData>();

            model.NodesSource = new ObservableCollection <ActivityDiagramNodeData>();

            model.LinksSource    = new ObservableCollection <ActivityDiagramLinkData>();
            model.Modifiable     = true;
            model.HasUndoManager = false;
            diagram.Model        = model;
            diagram.AllowDrop    = true;
            var labelTool = new SimpleLabelDraggingTool();

            labelTool.Diagram = diagram;
            diagram.MouseMoveTools.Insert(0, labelTool);
            palette.Model                 = new GraphLinksModel <ActivityDiagramNodeData, String, String, ActivityDiagramLinkData>();
            flowPalette.Model             = new GraphLinksModel <ActivityDiagramNodeData, String, String, ActivityDiagramLinkData>();
            flowPalette.Model.NodesSource = new List <ActivityDiagramNodeData>()
            {
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_INITIAL_ACTIVITY, Category = Constants.UML_AD_INITIAL_ACTIVITY, Name = Constants.UML_AD_INITIAL_ACTIVITY
                },
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_FINAL_ACTIVITY, Category = Constants.UML_AD_FINAL_ACTIVITY, Name = Constants.UML_AD_FINAL_ACTIVITY
                },
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_DECISION, Category = Constants.UML_AD_DECISION, Name = Constants.UML_AD_DECISION
                },
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_DECISION_MERGE, Category = Constants.UML_AD_DECISION_MERGE, Name = Constants.UML_AD_DECISION_MERGE
                },
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_FORK, Category = Constants.UML_AD_FORK, Name = Constants.UML_AD_FORK
                },
                new ActivityDiagramNodeData()
                {
                    Key = Constants.UML_AD_JOIN, Category = Constants.UML_AD_JOIN, Name = Constants.UML_AD_JOIN
                },
            };

            model.NodeKeyPath      = "Key";
            model.LinkFromPath     = "From";
            model.LinkToPath       = "To";
            model.NodeCategoryPath = "Category";
            model.NodeIsGroupPath  = "IsSubGraph";
            model.GroupNodePath    = "SubGraphKey";
        }
        public ClassDiagramPage()
        {
            InitializeComponent();
            LinkTypes = new List <LinkTypeComboBoxItem>()
            {
                new LinkTypeComboBoxItem(1, Constants.UML_CD_ASSOCIATION),
                new LinkTypeComboBoxItem(2, Constants.UML_CD_AGGREGATION),
                new LinkTypeComboBoxItem(3, Constants.UML_CD_GENERALIZATION),
                new LinkTypeComboBoxItem(4, Constants.UML_CD_ANCHOR)
            };
            SelectedLinkType                   = LinkTypes.First().Name;
            linkTypeComboBox.ItemsSource       = LinkTypes.OrderBy(item => item.Id);
            linkTypeComboBox.DisplayMemberPath = "Name";
            linkTypeComboBox.SelectedValuePath = "Name";
            linkTypeComboBox.SelectedValue     = Constants.UML_CD_ASSOCIATION;

            Application.Current.MainWindow.Width  = 1000;
            Application.Current.MainWindow.Height = 600;
            DiagramModel                  = new GraphLinksModel <ClassDiagramNodeData, String, String, ClassDiagramLinkData>();
            DiagramModel.NodesSource      = new ObservableCollection <ClassDiagramNodeData>();
            DiagramModel.LinksSource      = new ObservableCollection <ClassDiagramLinkData>();
            DiagramModel.Modifiable       = true;
            DiagramModel.HasUndoManager   = false;
            DiagramModel.NodeKeyPath      = "Key";
            DiagramModel.LinkFromPath     = "From";
            DiagramModel.LinkToPath       = "To";
            DiagramModel.NodeCategoryPath = "Category";
            DiagramModel.NodeIsGroupPath  = "IsSubGraph";
            DiagramModel.GroupNodePath    = "SubGraphKey";

            diagram.Model     = DiagramModel;
            diagram.AllowDrop = true;

            var labelTool = new SimpleLabelDraggingTool();

            labelTool.Diagram = diagram;
            diagram.MouseMoveTools.Insert(0, labelTool);

            palette.Model = new GraphLinksModel <ClassDiagramNodeData, String, String, ClassDiagramLinkData>();

            notePalette.Model             = new GraphLinksModel <ClassDiagramNodeData, String, String, ClassDiagramLinkData>();
            notePalette.Model.NodesSource = new List <ClassDiagramNodeData>()
            {
                new ClassDiagramNodeData()
                {
                    Key = "Note", Category = "Note", Name = "Note"
                }
            };
        }