public DataNodeTabViewModel(EditorEnvironment editorEnvironment) : base("DataNodes", editorEnvironment) { var nodeFactory = new DataNodeFactory(editorEnvironment); var comboBoxValues = new List <string> { "Test", "A", "42" }; nodeFactory.ComboBoxValueProviders["TestSelection"] = new ComboBoxValueProvider(() => comboBoxValues); editorEnvironment.NodeFactory = nodeFactory; EditorViewModel = new TreeEditorViewModel(editorEnvironment); EditorViewModel.AddDefaultCommands(); EditorViewModel.AddDefaultContextMenuCommands(); var catalogTypes = new List <Type> { typeof(SubData) }; EditorViewModel.CatalogItems.AddItems(NodeCatalogItem.CreateItemsForTypes(catalogTypes)); EditorViewModel.ContextMenuCommands.Add(Commands.ContextMenuCommand.Seperator); EditorViewModel.ContextMenuCommands.Add(new Commands.ContextMenuCommand("TestDataNodeWriteRead", TestDataNodeWriteRead)); EditorViewModel.ContextMenuCommands.Add(new Commands.ContextMenuCommand("WriteToFile", WriteToFile)); EditorViewModel.ContextMenuCommands.Add(new Commands.ContextMenuCommand("ReadFromFile", ReadFromFile)); EditorViewModel.ContextMenuCommands.Add(Commands.ContextMenuCommand.Seperator); var dialogRootNode = nodeFactory.CreateDataNode(typeof(RootData)); EditorViewModel.AddRootNode(dialogRootNode); }
public DefaultTabViewModel(EditorEnvironment editorEnvironment) : base("Default", editorEnvironment) { editorEnvironment.NodeFactory = new TreeNodeFactory(editorEnvironment); EditorViewModel = new TreeEditorViewModel(editorEnvironment); EditorViewModel.AddDefaultCommands(); EditorViewModel.AddDefaultContextMenuCommands(); EditorViewModel.CatalogItems.AddItems(NodeCatalogItem.CreateItemsForAssignableTypes(typeof(IDefaultNode), Assembly.GetExecutingAssembly())); var containerNode = editorEnvironment.NodeFactory.CreateNode <DefaultContainer>(); EditorViewModel.AddRootNode(containerNode); }
public DialogTabViewModel(EditorEnvironment editorEnvironment) : base("Dialog", editorEnvironment) { var nodeFactory = new CustomNodeFactory(editorEnvironment); editorEnvironment.NodeFactory = nodeFactory; EditorViewModel = new TreeEditorViewModel(editorEnvironment); EditorViewModel.AddDefaultCommands(); EditorViewModel.AddDefaultContextMenuCommands(); EditorViewModel.CatalogItems.AddItems(NodeCatalogItem.CreateItemsForAssignableTypes(typeof(DialogNode), Assembly.GetExecutingAssembly())); EditorViewModel.CatalogItems.Add(new NodeCatalogItem(ShowTextHelloWorldCatalogName, "Actions", "ShowText with 'Hello world!'", typeof(ShowTextAction))); EditorViewModel.ContextMenuCommands.Add(new Commands.ContextMenuCommand("Say 'Hello world!'", () => EditorViewModel.SelectedNode is ShowTextAction, () => (EditorViewModel.SelectedNode as ShowTextAction).Text = "Hello world!")); var dialogRootNode = nodeFactory.CreateDialogRootNode(); EditorViewModel.AddRootNode(dialogRootNode); }