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)); }
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>(); }
public override void GetContent(Invert.Core.GraphDesigner.IDocumentationBuilder _) { base.GetContent(_); _.Paragraph("While services can serve for almost any purpose, they can be used to seperate various features of uFrame, and your application. " + "Examples might include, FacebookService, NetworkingService, AchievementsService...etc"); _.Break(); _.Paragraph("As a matter of fact, at the time of this writing, uFrame ships with two default services, The 'ViewService', and the 'SceneManagementService'."); _.Break(); _.Paragraph("There is really only one general rule of thumb when implementing services, " + "they should only be listening to events, processing them, and publishing its own " + "events that might be useful to other services. While you can inject other services " + "and use them directly, it's highly reommended to use events as the means of communication."); _.Break(); _.Title2("Accesing ViewModels in services."); _.Paragraph("To access a running list of a specific viewmodel just add this property to any service, and make sure you specify the viewmodel type you need."); _.CodeSnippet("[Inject] IViewModelManager<PlayerViewModel> AllPlayers { get;set; }"); _.LinkToPage<ViewModelManagers>(); var service = ServiceNode(); _.Title2("Designer File Implementation"); _.TemplateExample<ServiceTemplate, ServiceNode>(service); _.Break(); _.Title2("Editable File Implementation"); _.TemplateExample<ServiceTemplate, ServiceNode>(service,false); }