Skip to content

Commit

Permalink
Added padding to allow dragging nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
haacked committed Mar 6, 2012
1 parent 52ae7d1 commit 3702b1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion SeeGitApp/MainWindow.xaml
Expand Up @@ -5,7 +5,8 @@
xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" xmlns:local="clr-namespace:SeeGit"
xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:view="clr-namespace:SeeGit.Views"
x:Class="SeeGit.MainWindow" Title="GraphSharpDemo" Height="465" Width="708" mc:Ignorable="d">
xmlns:extbehaviour="clr-namespace:WPFExtensions.AttachedBehaviours;assembly=WPFExtensions" x:Class="SeeGit.MainWindow"
Title="GraphSharpDemo" Height="465" Width="708" mc:Ignorable="d">
<Window.Resources>

<DataTemplate x:Key="commitDetailsTemplate" DataType="{x:Type local:CommitVertex}">
Expand All @@ -22,6 +23,11 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="extbehaviour:DragBehaviour.IsDragEnabled" Value="True" />
<Setter Property="extbehaviour:DragBehaviour.X"
Value="{Binding RelativeSource={RelativeSource Self},Path=(graphsharp:GraphCanvas.X),Mode=TwoWay}" />
<Setter Property="extbehaviour:DragBehaviour.Y"
Value="{Binding RelativeSource={RelativeSource Self},Path=(graphsharp:GraphCanvas.Y),Mode=TwoWay}" />
</Style>
</Window.Resources>

Expand Down
7 changes: 6 additions & 1 deletion SeeGitApp/Views/CommitVertexView.xaml
Expand Up @@ -30,13 +30,18 @@
<DropShadowEffect BlurRadius="2" Color="LightGray" Opacity="0.3" Direction="315" />
</Border.Effect>

<Expander IsExpanded="False" Header="{Binding ShortSha, Mode=OneWay}" ToolTip="{Binding Message, Mode=OneWay}">
<Expander IsExpanded="False" Header="{Binding ShortSha, Mode=OneWay}" Padding="5"
ToolTip="{Binding Message, Mode=OneWay}">
<Expander.Style>
<Style TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="White" />
<Setter Property="FontFamily" Value="Lucida Console" />
</Style>
</Expander.Style>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Message}" Foreground="White" TextWrapping="Wrap" MaxWidth="100" />
<TextBlock Text="Other info goes here" Foreground="White" TextWrapping="Wrap" />
</StackPanel>
</Expander>
</Border>
</AdornerDecorator>
Expand Down

0 comments on commit 3702b1a

Please sign in to comment.