/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Views/DiffView.axaml.cs
46 строк
1 KB
leo
fix: auto-navigating to first change sometimes does not work (#1952)
04 дек 2025, 06:13
04 дек 2025, 06:13
f318eca
Код
Авторство
О чём код?
using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.VisualTree; namespace SourceGit.Views { public partial class DiffView : UserControl { public DiffView() { InitializeComponent(); } protected override void OnLoaded(RoutedEventArgs e) { base.OnLoaded(e); if (DataContext is ViewModels.DiffContext vm) vm.CheckSettings(); } private void OnGotoFirstChange(object _, RoutedEventArgs e) { this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoChange(ViewModels.BlockNavigationDirection.First); e.Handled = true; } private void OnGotoPrevChange(object _, RoutedEventArgs e) { this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoChange(ViewModels.BlockNavigationDirection.Prev); e.Handled = true; } private void OnGotoNextChange(object _, RoutedEventArgs e) { this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoChange(ViewModels.BlockNavigationDirection.Next); e.Handled = true; } private void OnGotoLastChange(object _, RoutedEventArgs e) { this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoChange(ViewModels.BlockNavigationDirection.Last); e.Handled = true; } } }