private void AddNewPriority(NodeView nodeView)
        {
            AddEditIssuePriorityDialog dialog = new AddEditIssuePriorityDialog();
            dialog.DataContext = new AddEditPriorityModel { View = dialog };
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        NodeView child = new NodeView(nodeView)
                        {
                            Id = dialog.IssuePriority.Id,
                            Name = dialog.IssuePriority.Name,
                            Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                            Type = NodeType.IssuePriorityNode,
                            HasChildren = false,
                            SortField = dialog.IssuePriority.Ordinal.ToString()
                        };

                        if (nodeView.ChildrenLoaded)
                        {
                            nodeView.Children.Add(child);
                            nodeView.Sort();
                        }
                    }
                };
        }
        private void EditPriority(NodeView nodeView)
        {
            AddEditIssuePriorityDialog dialog = new AddEditIssuePriorityDialog(nodeView.Id);
            dialog.Title = "Edit Issue Priority";

            dialog.Show();
            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.IssuePriority.Name;
                        nodeView.SortField = dialog.IssuePriority.Ordinal.ToString();
                        nodeView.Parent.Sort();
                    }
                };
        }