2024-02-05 23:08:37 -08:00
|
|
|
|
using Avalonia.Collections;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SourceGit.ViewModels {
|
|
|
|
|
public class LauncherPage : PopupHost {
|
|
|
|
|
public RepositoryNode Node {
|
|
|
|
|
get => _node;
|
|
|
|
|
set => SetProperty(ref _node, value);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-02 06:45:14 -08:00
|
|
|
|
public object Data {
|
|
|
|
|
get => _data;
|
|
|
|
|
set => SetProperty(ref _data, value);
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AvaloniaList<Models.Notification> Notifications {
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
} = new AvaloniaList<Models.Notification>();
|
|
|
|
|
|
|
|
|
|
public LauncherPage() {
|
|
|
|
|
_node = new RepositoryNode() {
|
|
|
|
|
Id = Guid.NewGuid().ToString(),
|
|
|
|
|
Name = "WelcomePage",
|
|
|
|
|
Bookmark = 0,
|
|
|
|
|
IsRepository = false,
|
|
|
|
|
};
|
2024-03-02 06:45:14 -08:00
|
|
|
|
_data = new Welcome();
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LauncherPage(RepositoryNode node, Repository repo) {
|
|
|
|
|
_node = node;
|
2024-03-02 06:45:14 -08:00
|
|
|
|
_data = repo;
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string GetId() {
|
|
|
|
|
return _node.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CopyPath() {
|
|
|
|
|
if (_node.IsRepository) App.CopyText(_node.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DismissNotification(object param) {
|
|
|
|
|
if (param is Models.Notification notice) {
|
|
|
|
|
Notifications.Remove(notice);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private RepositoryNode _node = null;
|
2024-03-02 06:45:14 -08:00
|
|
|
|
private object _data = null;
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
|
|
|
|
}
|