mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
refactor: code cleanup
This commit is contained in:
parent
04f4293421
commit
fa3a3b2dad
25 changed files with 174 additions and 233 deletions
|
@ -3,7 +3,6 @@ using System;
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
|
@ -90,15 +89,6 @@ namespace SourceGit.Views
|
|||
set => SetValue(GraphProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<DataGrid> BindingDataGridProperty =
|
||||
AvaloniaProperty.Register<CommitGraph, DataGrid>(nameof(BindingDataGrid));
|
||||
|
||||
public DataGrid BindingDataGrid
|
||||
{
|
||||
get => GetValue(BindingDataGridProperty);
|
||||
set => SetValue(BindingDataGridProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush> DotBrushProperty =
|
||||
AvaloniaProperty.Register<CommitGraph, IBrush>(nameof(DotBrush), Brushes.Transparent);
|
||||
|
||||
|
@ -108,17 +98,13 @@ namespace SourceGit.Views
|
|||
set => SetValue(DotBrushProperty, value);
|
||||
}
|
||||
|
||||
static CommitGraph()
|
||||
{
|
||||
AffectsRender<CommitGraph>(BindingDataGridProperty, GraphProperty, DotBrushProperty);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
{
|
||||
base.Render(context);
|
||||
|
||||
var parent = this.FindAncestorOfType<Histories>();
|
||||
var graph = Graph;
|
||||
var grid = BindingDataGrid;
|
||||
var grid = parent.commitDataGrid;
|
||||
if (graph == null || grid == null)
|
||||
return;
|
||||
|
||||
|
@ -277,8 +263,6 @@ namespace SourceGit.Views
|
|||
public Histories()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Bind(NavigationIdProperty, new Binding("NavigationId", BindingMode.OneWay));
|
||||
}
|
||||
|
||||
private void OnCommitDataGridLayoutUpdated(object sender, EventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue