mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
refactor: use bindings instead of sync manually
This commit is contained in:
parent
e432559a5e
commit
54ef9c0bf7
3 changed files with 2 additions and 14 deletions
|
@ -63,8 +63,8 @@ namespace SourceGit.Models
|
|||
{
|
||||
public string File { get; set; } = string.Empty;
|
||||
public List<TextDiffLine> Lines { get; set; } = new List<TextDiffLine>();
|
||||
public Vector SyncScrollOffset { get; set; } = Vector.Zero;
|
||||
public int MaxLineNumber = 0;
|
||||
public Vector SyncScrollOffset = Vector.Zero;
|
||||
|
||||
public void GenerateNewPatchFromSelection(Change change, string fileBlobGuid, TextDiffSelection selection, bool revert, string output)
|
||||
{
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
<!-- Text Diff -->
|
||||
<DataTemplate DataType="m:TextDiff">
|
||||
<v:TextDiffView TextDiff="{Binding}"
|
||||
SyncScrollOffset="{Binding SyncScrollOffset, Mode=TwoWay}"
|
||||
UseSideBySideDiff="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSideBySideDiff, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
|
||||
|
|
|
@ -1169,19 +1169,11 @@ namespace SourceGit.Views
|
|||
if (change.Property == TextDiffProperty)
|
||||
{
|
||||
if (TextDiff == null)
|
||||
{
|
||||
Content = null;
|
||||
}
|
||||
else if (UseSideBySideDiff)
|
||||
{
|
||||
Content = new ViewModels.TwoSideTextDiff(TextDiff);
|
||||
SyncScrollOffset = TextDiff.SyncScrollOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
Content = TextDiff;
|
||||
SyncScrollOffset = TextDiff.SyncScrollOffset;
|
||||
}
|
||||
}
|
||||
else if (change.Property == UseSideBySideDiffProperty)
|
||||
{
|
||||
|
@ -1194,11 +1186,6 @@ namespace SourceGit.Views
|
|||
else
|
||||
Content = TextDiff;
|
||||
}
|
||||
else if (change.Property == SyncScrollOffsetProperty)
|
||||
{
|
||||
if (TextDiff != null)
|
||||
TextDiff.SyncScrollOffset = SyncScrollOffset;
|
||||
}
|
||||
}
|
||||
|
||||
private Models.TextDiffSelection GetUnifiedSelection(int startLine, int endLine, bool isOldSide)
|
||||
|
|
Loading…
Reference in a new issue