public GraphViewModel(IInspectorTool inspectorTool) { DisplayName = "[New Graph]"; _elements = new BindableCollection <ElementViewModel>(); _connections = new BindableCollection <ConnectionViewModel>(); _inspectorTool = inspectorTool; var element1 = AddElement <ImageSource>(100, 50); element1.Bitmap = BitmapUtility.CreateFromBytes(DesignTimeImages.Desert); var element2 = AddElement <ColorInput>(100, 300); element2.Color = Colors.Green; var element3 = AddElement <Add>(400, 250); Connections.Add(new ConnectionViewModel( element1.OutputConnector, element3.InputConnectors[0])); Connections.Add(new ConnectionViewModel( element2.OutputConnector, element3.InputConnectors[1])); element1.IsSelected = true; }
public StartupPackage(IOutput output, IInspectorTool inspectorTool, IStatusBarDataModelService statusBarService, IToolboxService toolboxService) { _output = output; _inspectorTool = inspectorTool; _statusBarService = statusBarService; _toolboxService = toolboxService; }
public SheetDocumentViewModel(Sheet sheet, IInspectorTool inspectorTool, IAPlayAwareShell shell, Action <SheetDocumentViewModel> onOpenedChanged, Client client) { _sheet = sheet; _inspectorTool = inspectorTool; _shell = shell; _onOpenedChanged = onOpenedChanged; _client = client; _name = _sheet.Name; SheetId = _sheet.Id; DisplayName = _name; _symbolVms = new BindableCollection <SymbolBaseViewModel>(); _connections = new BindableCollection <ConnectionViewModel>(); foreach (var blockSymbol in _sheet.BlockSymbols) { _symbolVms.Add(new BlockViewModel(blockSymbol, _client, _inspectorTool)); } foreach (var connector in _sheet.Connectors) { _symbolVms.Add(new ConnectorViewModel(connector, client, _inspectorTool)); } foreach (var connection in _sheet.Connections) { _connections.Add(new ConnectionViewModel(connection, _client, _inspectorTool)); } _sheet.NameChangeEventHandler += _sheet_NameChangeEventHandler; _sheet.BlockSymbolsAddEventHandler += OnBlockSymbolsAddEventHandler; _sheet.BlockSymbolsInsertAtEventHandler += OnBlockSymbolsInsertAtEventHandler; _sheet.BlockSymbolsRemoveAtEventHandler += OnBlockSymbolsRemoveAtEventHandler; _sheet.ConnectorsAddEventHandler += OnConnectorAddEventHandler; _sheet.ConnectorsInsertAtEventHandler += OnConnectorInsertAtEventHandler; _sheet.ConnectorsRemoveAtEventHandler += OnConnectorRemoveAtEventHandler; _sheet.ConnectionsAddEventHandler += OnConnectionsAddEventHandler; _sheet.ConnectionsRemoveEventHandler += OnConnectionsRemoveEventHandler; _sheet.ConnectionsRemoveAtEventHandler += OnConnectionsRemoveAtEventHandler; _sheet.ConnectionsInsertAtEventHandler += OnConnectionsInsertAtEventHandler; }
public ConnectionViewModel(Connection connection, Client client, IInspectorTool inspectorTool) { _connection = connection; _client = client; Id = connection.Id; FromPosition = new Point(_connection.FromPosition.X, _connection.FromPosition.Y); ToPosition = new Point(_connection.ToPosition.X, _connection.ToPosition.Y); //Register for changes triggerd by the model. _connection.FromPositionChangeEventHandler += ConnectionOnFromPositionChangeEventHandler; _connection.ToPositionChangeEventHandler += ConnectionOnToPositionChangeEventHandler; }
public BlockViewModel(BlockSymbol blockSymbol, Client client, IInspectorTool inspectorTool) { Id = blockSymbol.Id; _blockSymbol = blockSymbol; _client = client; _inspectorTool = inspectorTool; _x = _blockSymbol.PositionX; _y = _blockSymbol.PositionY; _blockSymbol.PositionXChangeEventHandler += x => X = x; _blockSymbol.PositionYChangeEventHandler += y => Y = y; }
public ConnectorViewModel(Connector connector, Client client, IInspectorTool inspectorTool) : this() { _connector = connector; _client = client; _inspectorTool = inspectorTool; Id = _connector.Id; _x = _connector.PositionX; _y = _connector.PositionY; _connector.PositionXChangeEventHandler += x => X = x; _connector.PositionYChangeEventHandler += y => Y = y; }
public SheetTreeViewModel(IAPlayAwareShell shell, IInspectorTool inspectorTool) { _shell = shell; _inspectorTool = inspectorTool; DisplayName = "Sheet Tree"; Sheets = new BindableCollection <SheetDocumentViewModel>(); _shell.ProjectChanged += OnProjectChanged; if (shell.Project != null) { if (shell.Project.SheetManager.Sheets != null) { Sheets.AddRange(shell.Project.SheetManager.Sheets.Select(sheet => new SheetDocumentViewModel(sheet, inspectorTool, shell, OnOpenedChanged, _shell.Client))); } } }
public Module(IOutput output, IInspectorTool inspectorTool) { _output = output; _inspectorTool = inspectorTool; }
public Module(IInspectorTool inspectorTool) { _inspectorTool = inspectorTool; }
public Module(IOutput output, IInspectorTool inspectorTool) { Output = output; _inspectorTool = inspectorTool; }
public Module(IInspectorTool inspectorTool) { this.inspectorTool = inspectorTool; }
public GraphViewModel(string title) { Title = title; _inspectorTool = Locator.Current.GetService <IInspectorTool>(); }
public Module(IOutput output, IInspectorTool inspectorTool, LoggerFacory logger) { _output = output; _inspectorTool = inspectorTool; LogManager.Adapter = logger; }
public Module(IOutput output, IInspectorTool inspectorTool) { _output = output; }