/
MainWindow.xaml
88 lines (79 loc) · 4.44 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" xmlns:local="clr-namespace:SeeGit"
xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"
xmlns:view="clr-namespace:SeeGit.Views"
xmlns:extbehaviour="clr-namespace:WPFExtensions.AttachedBehaviours;assembly=WPFExtensions"
x:Class="SeeGit.MainWindow"
Title="SeeGit" Height="465" Width="708" mc:Ignorable="d">
<Window.Resources>
<DataTemplate x:Key="commitDetailsTemplate" DataType="{x:Type local:CommitVertex}">
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding Description, Mode=OneWay}" Foreground="White" />
</StackPanel>
</DataTemplate>
<Style TargetType="{x:Type graphsharp:VertexControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type graphsharp:VertexControl}">
<view:CommitVertexView Model="{Binding}" />
</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>
<Window.CommandBindings>
<CommandBinding Command="Refresh" Executed="OnRefresh" />
</Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Key="F5" Command="Refresh" />
</Window.InputBindings>
<Grid d:DataContext="{d:DesignInstance {x:Type local:DesignTimeMainWindowViewModel}, IsDesignTimeCreatable=True}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" Background="Black" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="6" FlowDirection="LeftToRight">
<StackPanel.Resources>
<Style TargetType="{x:Type Label}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
</Style>
<Style TargetType="{x:Type ButtonBase}" x:Key="buttonStyle">
<Setter Property="Background" Value="Gray" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="0,2,6,2" />
<Setter Property="Padding" Value="3" />
</Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource buttonStyle}" />
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource buttonStyle}" />
</StackPanel.Resources>
<Label Margin="0,0,2,0" Content="Repository:" />
<Label Margin="0,0,6,0" Content="{Binding RepositoryPath}" />
<Button Click="OnChooseRepository" Content="Browse…" />
<Button Command="Refresh" Content="Refresh" />
<ToggleButton Name="settingsToggle" Click="OnToggleSettings" Content="Settings" />
</StackPanel>
<StackPanel Visibility="{Binding IsChecked, ElementName=settingsToggle, Converter={StaticResource BooleanToVisibilityConverter}}">
<view:SettingsView />
</StackPanel>
</StackPanel>
<zoom:ZoomControl Grid.Row="1" Zoom="0.2" ZoomBoxOpacity="0.5" Background="#ff656565" Style="{StaticResource SeeGitZoomControl}">
<local:RepositoryGraphLayout x:Name="graphLayout" Margin="10" Graph="{Binding Graph}"
LayoutAlgorithmType="{Binding LayoutAlgorithmType, Mode=OneWay}" OverlapRemovalAlgorithmType="FSA"
FlowDirection="LeftToRight" />
</zoom:ZoomControl>
</Grid>
</Window>