private static void OnOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; ConnectorOrientation oldO = (ConnectorOrientation)e.OldValue; ConnectorOrientation newO = (ConnectorOrientation)e.NewValue; //if (oldO != ConnectorOrientation.Unset) // bin.RaiseUpdate(); //bin.Model.Orientation = bin.Orientation; }
private static void OnMyValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; bin.FunctionColor = new SolidColorBrush(ColorHelper.GetLineColor(bin.Model.ConnectorType)); bin.IsMandatory = bin.Model.IsMandatory; bin.IsOutgoing = bin.Model.Outgoing; bin.Description = bin.Model.ToolTip; bin.Caption = bin.Model.Caption; //bin.Model.Orientation = bin.Orientation; }
private static void OnMarkedValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; ConnectorVisual selected = bin.WindowParent.EditorVisual.SelectedConnector; //if (selected == null) // return; //if (selected.Equals(bin)) // bin.CVLevel = null; //else // bin.CVLevel = Util.ConversionCheck(bin.Model, bin.WindowParent.EditorVisual.SelectedConnector.Model); }
private static void OnIsDraggedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; if (bin.Dragged != null) { bin.Dragged.Invoke(bin, new IsDraggedEventArgs() { IsDragged = bin.IsDragged }); } bin.RaiseUpdate(); }
private static void OnIsLinkingValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; if (bin.IsLinking == false) { bin.Marked = false; return; } if (bin.WindowParent == null || bin.WindowParent.EditorVisual == null || bin.WindowParent.EditorVisual.SelectedConnector == null) { bin.Marked = false; return; } ConnectorVisual selected = bin.WindowParent.EditorVisual.SelectedConnector; ConnectorModel input, output; input = selected.Model.Outgoing == true ? bin.Model : selected.Model; output = selected.Model.Outgoing == false ? bin.Model : selected.Model; if (bin == selected) { bin.CVLevel = new ConversionLevelInformation() { Level = ConversionLevel.NA } } ; else { ConversionLevel lvl = WorkspaceModel.compatibleConnectors(output, input); bin.CVLevel = new ConversionLevelInformation() { Level = lvl }; } if (bin.CVLevel.Level != ConversionLevel.Red && bin.CVLevel.Level != ConversionLevel.NA) { bin.Marked = true; } }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { ConnectorVisual connector = (ConnectorVisual)parameter; Point p = connector.GetAbsolutePosition(); switch (connector.Orientation) { case ConnectorOrientation.West: return(new Point(p.X, p.Y + connector.ActualHeight / 2)); case ConnectorOrientation.East: return(new Point(p.X + connector.ActualWidth, p.Y + connector.ActualHeight / 2)); case ConnectorOrientation.North: return(new Point(p.X + connector.ActualWidth / 2, p.Y)); case ConnectorOrientation.South: return(new Point(p.X + connector.ActualWidth / 2, p.Y + connector.ActualHeight)); } return(new Point(0, 0)); }
private static void OnSelectedConnectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; }
private static void OnPositionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ConnectorVisual bin = (ConnectorVisual)d; //bin.Model.Orientation = bin.Orientation; }