/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateFunction_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            SequenceParametersWindow win = new SequenceParametersWindow();

            win.Title                    = "New Function parameters";
            win.InputName                = "name of the function";
            win.InputDescription         = "";
            win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidFunctionName;
            win.Owner                    = MainWindow.Instance;

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

            SequenceFunction newSeq = new SequenceFunction(win.InputName);

            newSeq.Description = win.InputDescription;
            GraphDataManager.Instance.AddFunction(newSeq);

            FlowGraphControlViewModel wm = new FlowGraphControlViewModel(newSeq);

            wm.InitialNodeFromNewFunction();
            FlowGraphManager.Instance.Add(wm);

            MainWindow.Instance.FlowGraphManagerControl.OpenGraphInNewTab(newSeq);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenameFunction_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (listBoxGraphFunctions.SelectedItem != null &&
                listBoxGraphFunctions.SelectedItem is SequenceFunction)
            {
                FlowGraphControlViewModel flowGraphVM =
                    FlowGraphManager.Instance.GetViewModelByID((listBoxGraphFunctions.SelectedItem as SequenceBase).Id);

                SequenceParametersWindow win = new SequenceParametersWindow();
                win.Title                    = "Function " + flowGraphVM.Name + " parameters";
                win.InputName                = flowGraphVM.Name;
                win.InputDescription         = flowGraphVM.Description;
                win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidFunctionName;
                win.Owner                    = MainWindow.Instance;

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

                flowGraphVM.Sequence.Name        = win.InputName;
                flowGraphVM.Sequence.Description = win.InputDescription;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateFunction_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            SequenceParametersWindow win = new SequenceParametersWindow();
            win.Title = "New Function parameters";
            win.InputName = "name of the function";
            win.InputDescription = "";
            win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidFunctionName;
            win.Owner = MainWindow.Instance;

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

            SequenceFunction newSeq = new SequenceFunction(win.InputName);
            newSeq.Description = win.InputDescription;
            GraphDataManager.Instance.AddFunction(newSeq);

            FlowGraphControlViewModel wm = new FlowGraphControlViewModel(newSeq);
            wm.InitialNodeFromNewFunction();
            FlowGraphManager.Instance.Add(wm);

            MainWindow.Instance.FlowGraphManagerControl.OpenGraphInNewTab(newSeq);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RenameGraph_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (listBoxGraphs.SelectedItem != null
                && listBoxGraphs.SelectedItem is Sequence)
            {
                FlowGraphControlViewModel flowGraphVM =
                    FlowGraphManager.Instance.GetViewModelByID((listBoxGraphs.SelectedItem as Sequence).Id);

                SequenceParametersWindow win = new SequenceParametersWindow();
                win.Title = "Graph " + flowGraphVM.Name + " parameters";
                win.InputName = flowGraphVM.Name;
                win.InputDescription = flowGraphVM.Description;
                win.IsValidInputNameCallback = GraphDataManager.Instance.IsValidSequenceName;
                win.Owner = MainWindow.Instance;

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

                flowGraphVM.Sequence.Name = win.InputName;
                flowGraphVM.Sequence.Description = win.InputDescription;
            }
        }