public override void Loaded(UFrameContainer container) { base.Loaded(container); MVVM.HasSubNode <ServiceNode>(); MVVM.HasSubNode <SimpleClassNode>(); MVVM.HasSubNode <TypeReferenceNode>(); MVVM.Name = "MVVM Kernel Graph"; ComputedProperty.Name = "Computed Property"; Subsystem.HasSubNode <TypeReferenceNode>(); Element.HasSubNode <TypeReferenceNode>(); Subsystem.HasSubNode <EnumNode>(); Element.HasSubNode <EnumNode>(); Service.HasSubNode <EnumNode>(); Service.HasSubNode <SimpleClassNode>(); Service.HasSubNode <TypeReferenceNode>(); SceneType.Name = "Scene Type"; Subsystem.Name = "Sub System"; Service.Name = "Service"; ViewComponent.Name = "View Component"; StateMachine.Name = "State Machine"; BindingTypes = InvertGraphEditor.Container.Instances.Where(p => p.Key.Item1 == typeof(uFrameBindingType)).ToArray(); container.AddItemFlag <CommandsChildItem>("Publish", Color.green); container.RegisterConnectable <PropertiesChildItem, ComputedPropertyNode>();// container.Connectable<PropertiesChildItem, ComputedPropertyNode>(); }
public override void Initialize(UFrameContainer container) { base.Initialize(container); SubSystem.Name = "SubSystem"; SceneType.Name = "Scene Type"; container.AddWorkspaceConfig <MvvmWorkspace>("MVVM") .WithGraph <MVVMGraph>("MVVM", "Create MVVM") .WithGraph <SubSystemGraph>("SubSystem", "Create SubSystem"); MVVM.HasSubNode <TypeReferenceNode>(); SubSystem.HasSubNode <TypeReferenceNode>(); SubSystem.HasSubNode <EnumNode>(); Service.HasSubNode <TypeReferenceNode>(); Service.HasSubNode <EnumNode>(); Element.HasSubNode <TypeReferenceNode>(); Element.HasSubNode <EnumNode>(); uFrameMVVM.BindingTypes = InvertGraphEditor.Container.Instances.Where(p => p.Key.Item1 == typeof(uFrameBindingType)).ToArray(); }
/// <summary> /// Adds a new Customer /// </summary> public static Int32 AddCustomer(MVVM.DataAccess.Customer newCustomer) { MVVM_DemoDataContext context = new MVVM_DemoDataContext(); context.Customers.InsertOnSubmit(newCustomer); context.SubmitChanges(); return newCustomer.CustomerId; }
/// <summary> /// Updates an existing Order /// </summary> public static Boolean UpdateOrder(MVVM.DataAccess.Order newOrder) { MVVM_DemoDataContext context = new MVVM_DemoDataContext(); var orderToUpdate = context.Orders.Where(o => o.OrderId == newOrder.OrderId) .SingleOrDefault(); //update the values orderToUpdate.CustomerId = newOrder.CustomerId; orderToUpdate.Quantity = newOrder.Quantity; orderToUpdate.ProductId = newOrder.ProductId; orderToUpdate.DeliveryDate = newOrder.DeliveryDate; context.SubmitChanges(); return true; }
/// <summary> /// Updates an existing Customer /// </summary> public static Boolean UpdateCustomer(MVVM.DataAccess.Customer newCustomer) { MVVM_DemoDataContext context = new MVVM_DemoDataContext(); var customerToUpdate = context.Customers.Where(c => c.CustomerId == newCustomer.CustomerId) .SingleOrDefault(); //update the values customerToUpdate.FirstName = newCustomer.FirstName; customerToUpdate.LastName = newCustomer.LastName; customerToUpdate.Email = newCustomer.Email; customerToUpdate.HomePhoneNumber = newCustomer.HomePhoneNumber; customerToUpdate.MobilePhoneNumber = newCustomer.MobilePhoneNumber; customerToUpdate.Address1 = newCustomer.Address1; customerToUpdate.Address2 = newCustomer.Address2; customerToUpdate.Address3 = newCustomer.Address3; context.SubmitChanges(); return true; }
private void MainWindowMessageReceived(MVVM.Messaging.DialogMessage e) { this.mainWindow.DialogService.ShowMessage(e.Content, e.Caption, "Ok", null); }
public override void Initialize(Invert.IOC.UFrameContainer container) { container.RegisterInstance <IDocumentationProvider>(new uFrameMVVMDocumentationProvider(), "uFrameMVVM"); container.RegisterInstance <IEditorCommand>(GetCommandsSelectionCommand(), typeof(CommandsChildItem).Name + "TypeSelection");; container.AddTypeItem <CommandsChildItem>(); container.RegisterInstance <IEditorCommand>(GetPropertiesSelectionCommand(), typeof(PropertiesChildItem).Name + "TypeSelection");; container.AddTypeItem <PropertiesChildItem>(); container.RegisterInstance <IEditorCommand>(GetCollectionsSelectionCommand(), typeof(CollectionsChildItem).Name + "TypeSelection");; container.AddTypeItem <CollectionsChildItem>(); container.AddItem <BindingsReference>(); container.AddItem <SubPropertiesReference>(); container.AddTypeItem <InstancesReference>(); container.AddItem <TransitionsChildItem>(); container.AddItem <StateTransitionsReference>(); container.AddItem <HandlersReference>(); Element = container.AddNode <ElementNode, ElementNodeViewModel, ElementNodeDrawer>("Element"); Element.Inheritable(); Element.Color(NodeColor.DarkGray); Element.HasSubNode <SimpleClassNode>(); Element.HasSubNode <ViewNode>(); Element.HasSubNode <ComputedPropertyNode>(); Element.HasSubNode <StateMachineNode>(); Element.HasSubNode <ViewComponentNode>(); Element.HasSubNode <CommandNode>(); SimpleClass = container.AddNode <SimpleClassNode, SimpleClassNodeViewModel, SimpleClassNodeDrawer>("SimpleClass"); SimpleClass.Inheritable(); SimpleClass.Color(NodeColor.DarkDarkGray); View = container.AddNode <ViewNode, ViewNodeViewModel, ViewNodeDrawer>("View"); View.Inheritable(); View.Color(NodeColor.Blue); ComputedProperty = container.AddNode <ComputedPropertyNode, ComputedPropertyNodeViewModel, ComputedPropertyNodeDrawer>("ComputedProperty"); ComputedProperty.Color(NodeColor.Green); Subsystem = container.AddGraph <SubsystemGraph, SubsystemNode>("SubsystemGraph"); Subsystem.Color(NodeColor.Purple); Subsystem.HasSubNode <ElementNode>(); Subsystem.HasSubNode <SimpleClassNode>(); Subsystem.HasSubNode <CommandNode>(); Subsystem.HasSubNode <ServiceNode>(); SceneType = container.AddNode <SceneTypeNode, SceneTypeNodeViewModel, SceneTypeNodeDrawer>("SceneType"); SceneType.Color(NodeColor.Orange); MVVM = container.AddGraph <MVVMGraph, MVVMNode>("MVVMGraph"); MVVM.Color(NodeColor.Gray); MVVM.HasSubNode <SubsystemNode>(); MVVM.HasSubNode <SceneTypeNode>(); StateMachine = container.AddGraph <StateMachineGraph, StateMachineNode>("StateMachineGraph"); StateMachine.Color(NodeColor.Orange); StateMachine.HasSubNode <StateNode>(); State = container.AddNode <StateNode, StateNodeViewModel, StateNodeDrawer>("State"); State.Color(NodeColor.Green); ViewComponent = container.AddNode <ViewComponentNode, ViewComponentNodeViewModel, ViewComponentNodeDrawer>("ViewComponent"); ViewComponent.Color(NodeColor.Orange); Command = container.AddNode <CommandNode, CommandNodeViewModel, CommandNodeDrawer>("Command"); Command.Inheritable(); Command.Color(NodeColor.Black); Service = container.AddGraph <ServiceGraph, ServiceNode>("ServiceGraph"); Service.Color(NodeColor.Black); container.Connectable <ElementNode, InstancesReference>(); container.Connectable <ElementNode, Element>(); container.Connectable <PropertiesChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, SceneProperties>(); container.Connectable <PropertiesChildItem, SubPropertiesReference>(); container.Connectable <PropertiesChildItem, StateMachineNode>(); container.Connectable <CollectionsChildItem, BindingsReference>(); container.Connectable <CommandsChildItem, BindingsReference>(); container.Connectable <CommandsChildItem, TransitionsChildItem>(); container.Connectable <PropertiesChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, ComputedPropertyNode>(); container.Connectable <CollectionsChildItem, BindingsReference>(); container.Connectable <ViewNode, ViewComponentNode>(); container.Connectable <ComputedPropertyNode, TransitionsChildItem>(); container.Connectable <ComputedPropertyNode, ComputedPropertyNode>(); container.Connectable <TransitionsChildItem, StateTransitionsReference>(); container.Connectable <StartState, StateNode>(); container.Connectable <StateTransitionsReference, StateNode>(); }
public override void Initialize(uFrame.IOC.UFrameContainer container) { container.AddItem <BindingsReference>(); container.AddTypeItem <CommandsChildItem>(); container.AddItem <TransitionsChildItem>(); container.AddItem <HandlersReference>(); container.AddTypeItem <PropertiesChildItem>(); container.AddItem <SubPropertiesReference>(); container.AddTypeItem <InstancesReference>(); container.AddItem <StateTransitionsReference>(); container.AddTypeItem <CollectionsChildItem>(); Service = container.AddNode <ServiceNode, ServiceNodeViewModel, ServiceNodeDrawer>("Service"); Service.Inheritable(); Service.Color(NodeColor.Manganeseblue); Service.HasSubNode <SimpleClassNode>(); ComputedProperty = container.AddNode <ComputedPropertyNode, ComputedPropertyNodeViewModel, ComputedPropertyNodeDrawer>("ComputedProperty"); ComputedProperty.Inheritable(); ComputedProperty.Color(NodeColor.Green); SimpleClass = container.AddNode <SimpleClassNode, SimpleClassNodeViewModel, SimpleClassNodeDrawer>("SimpleClass"); SimpleClass.Inheritable(); SimpleClass.Color(NodeColor.Salmon2); SubSystem = container.AddGraph <SubSystemGraph, SubSystemNode>("SubSystemGraph"); SubSystem.Color(NodeColor.Blue); SubSystem.HasSubNode <ServiceNode>(); SubSystem.HasSubNode <SimpleClassNode>(); SubSystem.HasSubNode <ElementNode>(); SubSystem.HasSubNode <CommandNode>(); View = container.AddNode <ViewNode, ViewNodeViewModel, ViewNodeDrawer>("View"); View.Inheritable(); View.Color(NodeColor.Royalblue2); SceneType = container.AddNode <SceneTypeNode, SceneTypeNodeViewModel, SceneTypeNodeDrawer>("SceneType"); SceneType.Inheritable(); SceneType.Color(NodeColor.SgiBeet); Element = container.AddNode <ElementNode, ElementNodeViewModel, ElementNodeDrawer>("Element"); Element.Inheritable(); Element.Color(NodeColor.Violetred2); Element.HasSubNode <SimpleClassNode>(); Element.HasSubNode <ViewNode>(); Element.HasSubNode <CommandNode>(); Element.HasSubNode <ComputedPropertyNode>(); Element.HasSubNode <ViewComponentNode>(); Element.HasSubNode <StateMachineNode>(); Command = container.AddNode <CommandNode, CommandNodeViewModel, CommandNodeDrawer>("Command"); Command.Inheritable(); Command.Color(NodeColor.Indianred4); State = container.AddNode <StateNode, StateNodeViewModel, StateNodeDrawer>("State"); State.Color(NodeColor.Lightgoldenrod3); MVVM = container.AddGraph <MVVMGraph, MVVMNode>("MVVMGraph"); MVVM.Color(NodeColor.DarkGray); MVVM.HasSubNode <SimpleClassNode>(); MVVM.HasSubNode <SubSystemNode>(); MVVM.HasSubNode <SceneTypeNode>(); MVVM.HasSubNode <ServiceNode>(); ViewComponent = container.AddNode <ViewComponentNode, ViewComponentNodeViewModel, ViewComponentNodeDrawer>("ViewComponent"); ViewComponent.Inheritable(); ViewComponent.Color(NodeColor.SgiLightBlue); StateMachine = container.AddNode <StateMachineNode, StateMachineNodeViewModel, StateMachineNodeDrawer>("StateMachine"); StateMachine.Inheritable(); StateMachine.Color(NodeColor.Carrot); StateMachine.HasSubNode <StateNode>(); container.Connectable <ComputedPropertyNode, TransitionsChildItem>(); container.Connectable <ComputedPropertyNode, BindingsReference>(); container.Connectable <ViewNode, ViewComponentNode>(); container.Connectable <ViewNode, ViewNode>(); container.Connectable <ElementNode, InstancesReference>(); container.Connectable <ElementNode, Element>(); container.Connectable <StartState, StateNode>(); container.Connectable <CommandsChildItem, TransitionsChildItem>(); container.Connectable <CommandsChildItem, BindingsReference>(); container.Connectable <TransitionsChildItem, StateTransitionsReference>(); container.Connectable <HandlersReference, SimpleClassNode>(); container.Connectable <PropertiesChildItem, StateMachineNode>(); container.Connectable <PropertiesChildItem, SubPropertiesReference>(); container.Connectable <PropertiesChildItem, SceneProperties>(); container.Connectable <PropertiesChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, ComputedPropertyNode>(); container.Connectable <StateTransitionsReference, StateNode>(); container.Connectable <CollectionsChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, ComputedPropertyNode>(); container.Connectable <PropertiesChildItem, SubPropertiesReference>(); container.Connectable <PropertiesChildItem, BindingsReference>(); container.Connectable <PropertiesChildItem, SceneProperties>(); container.Connectable <PropertiesChildItem, StateMachineNode>(); container.Connectable <CollectionsChildItem, BindingsReference>(); }
public MainWindow() { InitializeComponent(); DataContext = new MVVM(); }