/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/ViewModels/ViewLogs.cs
34 строки
772 B
leo
enhance: auto-select the latest running git command log and auto-scroll to the end when new content is append to current viewing log (#1842)
04 ноя 2025, 05:42
04 ноя 2025, 05:42
9f541bd
Код
Авторство
О чём код?
using Avalonia.Collections; using CommunityToolkit.Mvvm.ComponentModel; namespace SourceGit.ViewModels { public class ViewLogs : ObservableObject { public AvaloniaList<CommandLog> Logs { get => _repo.Logs; } public CommandLog SelectedLog { get => _selectedLog; set => SetProperty(ref _selectedLog, value); } public ViewLogs(Repository repo) { _repo = repo; _selectedLog = repo.Logs?.Count > 0 ? repo.Logs[0] : null; } public void ClearAll() { SelectedLog = null; Logs.Clear(); } private Repository _repo = null; private CommandLog _selectedLog = null; } }