private void StackPanel_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { FrameworkElement vertexPanel = sender as FrameworkElement; YodiiGraphVertex vertex = vertexPanel.DataContext as YodiiGraphVertex; _vm.SelectedVertex = null; _vm.SelectedVertex = vertex; }
/// <summary> /// Selects template. /// </summary> /// <param name="item">Service or plugin.</param> /// <param name="container"></param> /// <returns></returns> public override DataTemplate SelectTemplate(object item, DependencyObject container) { if (item == null) { return(null); } YodiiGraphVertex vertex = (YodiiGraphVertex)item; if (vertex.IsPlugin) { return(PluginPropertiesTemplate); } else { return(ServicePropertiesTemplate); } }
/// <summary> /// Selects template. /// </summary> /// <param name="item">Service or plugin.</param> /// <param name="container"></param> /// <returns></returns> public override DataTemplate SelectTemplate(object item, DependencyObject container) { if (item == null) { return(null); } YodiiGraphVertex vertex = (YodiiGraphVertex)item; if (vertex.IsPlugin) { return(LivePluginDataTemplate); } else if (vertex.IsService) { return(LiveServiceDataTemplate); } return(null); }
public ServiceFamily(YodiiGraphVertex rootVertex, YodiiLayout parent) { SubPlugins = new Dictionary <IPluginInfo, YodiiGraphVertex>(); SubServices = new Dictionary <IServiceInfo, ServiceFamily>(); Debug.Assert(rootVertex.IsService); _parent = parent; RootVertex = rootVertex; RootVertexSize = _parent.VertexSizes[RootVertex]; RootService = rootVertex.LabServiceInfo.ServiceInfo; if (RootService.Generalization != null) { var generalizationFamily = parent.FindOrCreateServiceFamily(RootService.Generalization); ParentServiceFamily = generalizationFamily; ParentServiceFamily.RegisterSubService(this); } }
void Graph_VertexAdded(YodiiGraphVertex vertex) { var control = new VertexControl(vertex); if (vertex.IsService) { if (vertex.LabServiceInfo.ServiceInfo.PositionInGraph.IsValid()) { control.SetPosition(vertex.LabServiceInfo.ServiceInfo.PositionInGraph); } } else if (vertex.IsPlugin) { if (vertex.LabPluginInfo.PluginInfo.PositionInGraph.IsValid()) { control.SetPosition(vertex.LabPluginInfo.PluginInfo.PositionInGraph); } } GraphArea.AddVertex(vertex, control); DragBehaviour.SetUpdateEdgesOnMove(control, true); }
void Graph_VertexRemoved(YodiiGraphVertex vertex) { GraphArea.RemoveVertex(vertex); }
void Graph_VertexRemoved( YodiiGraphVertex vertex ) { GraphArea.RemoveVertex( vertex ); }
void Graph_VertexAdded( YodiiGraphVertex vertex ) { var control = new VertexControl( vertex ); if( vertex.IsService ) { if( vertex.LabServiceInfo.ServiceInfo.PositionInGraph.IsValid() ) control.SetPosition( vertex.LabServiceInfo.ServiceInfo.PositionInGraph ); } else if( vertex.IsPlugin ) { if( vertex.LabPluginInfo.PluginInfo.PositionInGraph.IsValid() ) control.SetPosition( vertex.LabPluginInfo.PluginInfo.PositionInGraph ); } GraphArea.AddVertex( vertex, control ); DragBehaviour.SetUpdateEdgesOnMove( control, true ); }
internal void RegisterPlugin(YodiiGraphVertex p) { Debug.Assert(!SubPlugins.Keys.Contains(p.LabPluginInfo.PluginInfo)); Debug.Assert(p.LabPluginInfo.PluginInfo.Service == RootService); SubPlugins.Add(p.LabPluginInfo.PluginInfo, p); }