public AddEditMobileOwnerDialog(int id)
        {
            InitializeComponent();

            AddEditMobileOwnerModel model = new AddEditMobileOwnerModel(id);
            model.View = this;

            model.DataLoaded += (s1) =>
                {
                    DataContext = model;
                    Utils.ResetOriginalValues(this);
                };
        }
        private void AddOwner(NodeView nodeView)
        {
            AddEditMobileOwnerDialog dialog = new AddEditMobileOwnerDialog();
            AddEditMobileOwnerModel addEditMobileOwnerModel = new AddEditMobileOwnerModel();
            addEditMobileOwnerModel.View = dialog;
            dialog.DataContext = addEditMobileOwnerModel;
            dialog.Show();

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