mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
enhance: only raise BlockNavigationChangedEvent
when UseBlockNavigation
enabled
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
9590f96a44
commit
d335cac167
2 changed files with 12 additions and 6 deletions
|
@ -1746,25 +1746,25 @@ namespace SourceGit.Views
|
|||
public void GotoFirstChange()
|
||||
{
|
||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoFirstChange();
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
TryRaiseBlockNavigationChanged();
|
||||
}
|
||||
|
||||
public void GotoPrevChange()
|
||||
{
|
||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoPrevChange();
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
TryRaiseBlockNavigationChanged();
|
||||
}
|
||||
|
||||
public void GotoNextChange()
|
||||
{
|
||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoNextChange();
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
TryRaiseBlockNavigationChanged();
|
||||
}
|
||||
|
||||
public void GotoLastChange()
|
||||
{
|
||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoLastChange();
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
TryRaiseBlockNavigationChanged();
|
||||
}
|
||||
|
||||
protected override void OnDataContextChanged(EventArgs e)
|
||||
|
@ -1818,7 +1818,7 @@ namespace SourceGit.Views
|
|||
else
|
||||
BlockNavigation = null;
|
||||
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
TryRaiseBlockNavigationChanged();
|
||||
}
|
||||
|
||||
private void OnStageChunk(object _1, RoutedEventArgs _2)
|
||||
|
@ -1990,5 +1990,11 @@ namespace SourceGit.Views
|
|||
repo.MarkWorkingCopyDirtyManually();
|
||||
repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
private void TryRaiseBlockNavigationChanged()
|
||||
{
|
||||
if (UseBlockNavigation)
|
||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue