Browse Source

Object graph - highlights edge on node item mouse-over.

pull/15/head
mkonicek 15 years ago
parent
commit
5736d53187
  1. 7
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml
  2. 19
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs

7
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml

@ -29,6 +29,8 @@ @@ -29,6 +29,8 @@
</ListView.Background>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<EventSetter Event="MouseEnter" Handler="ListViewItem_MouseEnter"></EventSetter>
<EventSetter Event="MouseLeave" Handler="ListViewItem_MouseLeave"></EventSetter>
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="0"></Setter>
<Setter Property="BorderThickness" Value="1" />
@ -54,7 +56,7 @@ @@ -54,7 +56,7 @@
</GridView.ColumnHeaderContainerStyle>
<!-- Databound item is ContentNode -->
<GridView.Columns>
<!-- Expand button (either property or nested) -->
<!-- Expand button (either property or nested) -->
<GridViewColumn Header="Plus" Width="20">
<GridViewColumn.CellTemplate>
<DataTemplate>
@ -73,11 +75,10 @@ @@ -73,11 +75,10 @@
Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<!-- Name -->
<!-- Name -->
<GridViewColumn Header="Name" Width="60">
<GridViewColumn.CellTemplate>
<DataTemplate>

19
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs

@ -197,6 +197,25 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing @@ -197,6 +197,25 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
if (this.ContentNodeCollapsed != null)
this.ContentNodeCollapsed(this, new ContentNodeEventArgs(node));
}
void ListViewItem_MouseEnter(object sender, MouseEventArgs e)
{
SetEdgeStrokeThickness((ListViewItem)e.Source, 2);
}
void ListViewItem_MouseLeave(object sender, MouseEventArgs e)
{
SetEdgeStrokeThickness((ListViewItem)e.Source, 1);
}
void SetEdgeStrokeThickness(ListViewItem listViewItem, int thickness)
{
var clickedNode = (ContentNode)listViewItem.DataContext;
var propNode = clickedNode as ContentPropertyNode;
if (propNode != null && propNode.Property != null && propNode.Property.Edge != null && propNode.Property.Edge.Spline != null) {
propNode.Property.Edge.Spline.StrokeThickness = thickness;
}
}
#endregion
}
}

Loading…
Cancel
Save