Skip to content
Browse files

Graph is now rendered fast.

  • Loading branch information...
1 parent 8d2d7eb commit f29eb6897275eee6f68fff6610eee6066e4282b7 @kaisellgren committed Jul 6, 2012
Showing with 7 additions and 12 deletions.
  1. +1 −2 UserControls/ChangesetHistory.xaml
  2. +6 −10 UserControls/ChangesetHistory.xaml.cs
View
3 UserControls/ChangesetHistory.xaml
@@ -105,8 +105,7 @@
<ScrollViewer Margin="0,24,0,0"
Grid.Row="0"
Width="128"
- Height="{Binding ElementName=ChangesetHistoryGrid, Converter={StaticResource getDataGridContentHeightConverter}}"
- ScrollViewer.VerticalScrollBarVisibility="Visible"
+ ScrollViewer.VerticalScrollBarVisibility="Hidden"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
HorizontalAlignment="Left"
VerticalAlignment="Top"
View
16 UserControls/ChangesetHistory.xaml.cs
@@ -2,14 +2,7 @@
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Shapes;
-using System.Windows.Threading;
using GG.Libraries;
-using GG.Models;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Threading;
namespace GG.UserControls
{
@@ -30,11 +23,11 @@ public ChangesetHistory()
/// </summary>
public void RedrawGraph()
{
- // Redraw.
- var changesetGraph = new ChangesetGraph((RepositoryViewModel)DataContext, Graph);
+ // Redraw the graph.
+ var changesetGraph = new ChangesetGraph((RepositoryViewModel) DataContext, Graph);
changesetGraph.Draw(ChangesetHistoryGrid.Items);
- // Set the height for the Graph element.
+ // Update the height for the Graph element.
Graph.Height = changesetGraph.TotalHeight;
// TODO: Set width also, and for the datagrid as well!
@@ -44,6 +37,9 @@ private void ChangesetHistoryGrid_ScrollChanged(object sender, ScrollChangedEven
{
var scrollViewer = UIHelper.FindChild<ScrollViewer>(this, "GraphScrollViewer");
scrollViewer.ScrollToVerticalOffset(Math.Floor(e.VerticalOffset) * 24);
+
+ var dataGrid = UIHelper.FindChild<DataGrid>(this, "ChangesetHistoryGrid");
+ scrollViewer.Height = Math.Abs(dataGrid.ActualHeight - 24);
}
}
}

0 comments on commit f29eb68

Please sign in to comment.
Something went wrong with that request. Please try again.