/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenameScript_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (listBoxGraphScripts.SelectedItem != null &&
                listBoxGraphScripts.SelectedItem is ScriptElement)
            {
                ScriptElement   el  = listBoxGraphScripts.SelectedItem as ScriptElement;
                NewScriptWindow win = new NewScriptWindow(el);
                //win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidName;
                win.Owner = MainWindow.Instance;

                if (win.ShowDialog() == false)
                {
                    return;
                }

                el.Name = win.InputName;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateScript_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            NewScriptWindow win = new NewScriptWindow();

            win.Title     = "New script";
            win.InputName = "name of the script";
            //win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidName;
            win.Owner = MainWindow.Instance;

            if (win.ShowDialog() == false)
            {
                return;
            }

            GraphDataManager.Instance.AddScript(new ScriptElement {
                Name = win.InputName
            });
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenameScript_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (listBoxGraphScripts.SelectedItem != null
                && listBoxGraphScripts.SelectedItem is ScriptElement)
            {
                ScriptElement el = listBoxGraphScripts.SelectedItem as ScriptElement;
                NewScriptWindow win = new NewScriptWindow(el);
                //win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidName;
                win.Owner = MainWindow.Instance;

                if (win.ShowDialog() == false)
                {
                    return;
                }

                el.Name = win.InputName;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateScript_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            NewScriptWindow win = new NewScriptWindow();
            win.Title = "New script";
            win.InputName = "name of the script";
            //win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidName;
            win.Owner = MainWindow.Instance;

            if (win.ShowDialog() == false)
            {
                return;
            }

            GraphDataManager.Instance.AddScript(new ScriptElement { Name = win.InputName });
        }