private void NewStateMachine()
        {
            try
            {
                var textEditService = new TextEditService();

                string initialName = StateMachines
                                     .Select(sm => sm.Name)
                                     .CreateUniqueName("State Machine {0}");

                textEditService.EditText(initialName, "State Machine Name", "Create State Machine", name =>
                {
                    var model = new StateMachine()
                    {
                        Name    = name,
                        Actions = new StateMachineOutputAction[] { },
                        Inputs  = new StateMachineInput[] { }
                    };

                    var viewService = ApplicationContainer.Container.Resolve <IViewService>();

                    var viewModel = new StateMachineReferenceViewModel(model, viewService, DirtyService, _messageBoxService);

                    StateMachines.Add(viewModel);

                    _dirtyService.MarkDirty();
                });
            }
            catch (Exception ex)
            {
                _messageBoxService.Show(ex);
            }
        }
 private void Edit(StateMachineReferenceViewModel stateMachineViewModel)
 {
     try
     {
         stateMachineViewModel.Edit();
     }
     catch (Exception e)
     {
         _messageBoxService.Show(e);
     }
 }