sourcegit/src/ViewModels/ViewLogs.cs
leo 021aab8408
enhance: add a button to clear all git command logs
Signed-off-by: leo <longshuang@msn.cn>
2025-04-17 16:07:40 +08:00

33 lines
701 B
C#

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;
}
public void ClearAll()
{
SelectedLog = null;
Logs.Clear();
}
private Repository _repo = null;
private CommandLog _selectedLog = null;
}
}