-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathBrowserView.xaml
113 lines (104 loc) · 5.51 KB
/
BrowserView.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!--
/*
* Copyright (C) 2009, Henon<[email protected]>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* - Neither the name of the project nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-->
<UserControl x:Class="GitSharp.Demo.BrowserView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="clr-namespace:GitSharp;assembly=GitSharp"
xmlns:HistoryGraph="clr-namespace:GitSharp.Demo.HistoryGraph"
xmlns:Demo="clr-namespace:GitSharp.Demo"
xmlns:Controls="clr-namespace:GitSharp.Demo.Controls"
MinHeight="300" MinWidth="300">
<UserControl.Resources>
<!--repository tree templates-->
<HierarchicalDataTemplate DataType="{x:Type g:Tree}" ItemsSource="{Binding Path=Children}">
<TextBlock Text="{Binding Name}" TextTrimming="CharacterEllipsis" ToolTip="{Binding Hash}"/>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type g:AbstractObject}">
<TextBlock Text="{Binding Name}" TextTrimming="CharacterEllipsis" Foreground="CornflowerBlue" ToolTip="{Binding Hash}"/>
</DataTemplate>
</UserControl.Resources>
<DockPanel >
<!--commit history graph-->
<DockPanel Width="400">
<Label DockPanel.Dock="Top" Style="{StaticResource HeaderLabelStyle}">Revision History</Label>
<HistoryGraph:HistoryGraphView x:Name="m_history_graph" DockPanel.Dock="Top" Height="300"/>
<Controls:DockPanelSplitter DockPanel.Dock="Top" Height="4"/>
<!--lower half-->
<Grid Grid.Row="2" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<!--tree-->
<DockPanel Grid.Column="0">
<Label DockPanel.Dock="Top" Name="m_tree_title" Style="{StaticResource HeaderLabelStyle}">Source Tree (select to show content)</Label>
<TreeView Name="m_tree"/>
</DockPanel>
<GridSplitter ResizeBehavior="PreviousAndNext" Width="2" Grid.Column="1"/>
<!--object-->
<DockPanel Grid.Column="2">
<Label DockPanel.Dock="Top" Name="m_object_title" Style="{StaticResource HeaderLabelStyle}">Blob contents of selected tree node</Label>
<RichTextBox Name="m_object" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"/>
</DockPanel>
</Grid>
</DockPanel>
<Controls:DockPanelSplitter DockPanel.Dock="Left" Width="4" BorderThickness="1"/>
<!--commit browser-->
<DockPanel DockPanel.Dock="Top">
<!--upper half-->
<DockPanel DockPanel.Dock="Top">
<!--tags and branches-->
<DockPanel Margin="0" DockPanel.Dock="Top">
<Label DockPanel.Dock="Top" Name="m_refs_title" Style="{StaticResource HeaderLabelStyle}">Selected Commit</Label>
<Demo:CommitSummaryView x:Name="m_commit_view"/>
</DockPanel>
<Controls:DockPanelSplitter DockPanel.Dock="Top" Height="4"/>
<!--commits-->
<DockPanel DockPanel.Dock="Top">
<Label DockPanel.Dock="Top" Name="m_commit_title" Style="{StaticResource HeaderLabelStyle}">Changes by this commit (select a modification to view the diff)</Label>
<Demo:CommitDiffView x:Name="m_commit_diff" DockPanel.Dock="Top" />
<Controls:DockPanelSplitter DockPanel.Dock="Top" Height="4"/>
<Label DockPanel.Dock="Top" Style="{StaticResource HeaderLabelStyle}">Differences</Label>
<Demo:TextDiffView x:Name="m_text_diff" DockPanel.Dock="Top" />
</DockPanel>
</DockPanel>
</DockPanel>
</DockPanel>
</UserControl>