From 0dee3a19691e07b781e3fa188e35328ddadf09cc Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 24 Jul 2024 11:16:28 +0800 Subject: [PATCH] refactor: use `Binding.TargetNullValue` instead of empty class `Models.CompareTargetWorktree` --- src/Models/CompareTargetWorktree.cs | 6 ---- src/ViewModels/RevisionCompare.cs | 4 +-- src/Views/RevisionCompare.axaml | 44 +++++++++++++++-------------- 3 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 src/Models/CompareTargetWorktree.cs diff --git a/src/Models/CompareTargetWorktree.cs b/src/Models/CompareTargetWorktree.cs deleted file mode 100644 index 6505f408..00000000 --- a/src/Models/CompareTargetWorktree.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SourceGit.Models -{ - public class CompareTargetWorktree - { - } -} diff --git a/src/ViewModels/RevisionCompare.cs b/src/ViewModels/RevisionCompare.cs index 6bfcf566..8ac6f823 100644 --- a/src/ViewModels/RevisionCompare.cs +++ b/src/ViewModels/RevisionCompare.cs @@ -71,8 +71,8 @@ namespace SourceGit.ViewModels public RevisionCompare(string repo, Models.Commit startPoint, Models.Commit endPoint) { _repo = repo; - _startPoint = (object)startPoint ?? new Models.CompareTargetWorktree(); - _endPoint = (object)endPoint ?? new Models.CompareTargetWorktree(); + _startPoint = startPoint; + _endPoint = endPoint; Task.Run(Refresh); } diff --git a/src/Views/RevisionCompare.axaml b/src/Views/RevisionCompare.axaml index bb101ae3..41439b6b 100644 --- a/src/Views/RevisionCompare.axaml +++ b/src/Views/RevisionCompare.axaml @@ -10,9 +10,8 @@ x:Class="SourceGit.Views.RevisionCompare" x:DataType="vm:RevisionCompare" Background="{DynamicResource Brush.Window}"> - - - + + @@ -27,25 +26,23 @@ - - - - - - - - + - - - - - + + + + + + + + + + @@ -56,11 +53,16 @@ - - - - - + + + + + + + + + +