コード例 #1
0
        public override void GetContent(Invert.Core.GraphDesigner.IDocumentationBuilder _)
        {
            base.GetContent(_);
            _.Paragraph("uFrame utilizes a new concept developed to fit the uFrame and RX paradigm of programming.  " +
                        "We like to call this \"Re-active\" state machines. ");
            _.Paragraph("The main concept of state machines in uFrame MVVM is that when defining them in your " +
                        "diagrams you don't need to focus on anything other than the states and transitions that " +
                        "make up the machine.  Making the machine come to life is a matter of wiring them to " +
                        "computed properties, command bindings, and view bindings.  But initially, you can focus " +
                        "purely on the high-level rather than implementation, once commands and transitions " +
                        "are all wired together transitions and states can be easily tweaked with minimal to " +
                        "zero changes in your code.");
            _.Paragraph("Reactive State Machines employ the concept of data subscriptions causing transitions, rather than polling data every frame, this can give a definite increase in performance.");
            _.Break();
            _.ImageByUrl("http://i.imgur.com/CPymbPH.png");
            _.Break();
            _.Title2("Manually triggering transitions");
            _.Paragraph("To set a transition in code, you'll need to access the state machine property.  This should be the property that is connected to your state machine.");
            _.CodeSnippet("{ViewModel}.{StateMachinePropertyName}Property.Transition(\"NAME OF TRANSITION HERE\");");
            _.Break();
            _.Title2("Manually setting the state");
            _.CodeSnippet("{ViewModel}.{StateMachinePropertyName}Property.SetState<STATE_CLASS_NAME>();");
            _.Title3("or");
            _.CodeSnippet("{ViewModel}.{StateMachinePropertyName}Property.SetState(\"STATE_NAME\");");
            _.Break();



//            _.AlsoSeePages(typeof(UsingStateMachines));
        }
コード例 #2
0
        public override void GetContent(Invert.Core.GraphDesigner.IDocumentationBuilder _)
        {
            base.GetContent(_);
            _.Paragraph("Commands define a property of type ISignal<TCommandClass> on an element.  These act as a delegate to a pre-initialized handler." +
                        "The handlers are setup in the controllers initialize method to point to a method, this makes a controller a factory for a view-model." +
                        "");

            var ele = new ScaffoldGraph()
                      .BeginNode <ElementNode>("Player")
                      .AddItem <CommandsChildItem>("Hit")
                      .EndNode();

            _.Title2("Executing a command from a viewmodel.");
            _.CodeSnippet("MyViewModel.CommandName.OnNext(new {CommandName}Command() { });");
            _.Break();
            _.Title2("Generated Model Commands");
            _.TemplateExample <ViewModelTemplate, ElementNode>(ele as ElementNode, true, "CommandItems", "Bind");
            _.Break();
            _.Title2("Generated Controller Command Handlers");
            _.TemplateExample <ControllerTemplate, ElementNode>(ele as ElementNode, true, "CommandItems", "CommandMethod");
            _.Break();

            _.Break();
            _.Title3("Also See");
            _.LinkToPage <Controllers>();
            _.LinkToPage <CreationAndInitialization>();
        }