private void AddWorkflow()
        {
            var model = new Workflow().Default();
            var vm    = new WorkflowViewModel(model);

            Workflows.Add(vm);
        }
 public StateViewModel(State model, WorkflowViewModel workflow)
 {
     Model     = model;
     _Workflow = workflow;
     if (Model.Name.Equals(_Workflow.Model.Machine.BeginState))
     {
         _IsBegin = true;
     }
     if (_Workflow.Model.Machine.EndStates.Contains(Model.Name))
     {
         _IsEnd = true;
     }
 }
        public TransitionViewModel(Transition model, WorkflowViewModel workflow)
        {
            Model  = model;
            States = workflow.States;
            var from = States.FirstOrDefault(x => x.Name.Equals(Model.OriginState));

            if (from != null)
            {
                _From = from;
            }
            var to = States.FirstOrDefault(x => x.Name.Equals(Model.DestinationState));

            if (to != null)
            {
                _To = to;
            }
            _Workflow = workflow;
        }