Add initial project structure with basic view models, views, and resources

This commit is contained in:
2026-09-14 19:46:46 +03:00
commit 45401645c6
68 changed files with 2538 additions and 0 deletions
@@ -0,0 +1,45 @@
using Avalonia;
using Avalonia.Controls;
using CryptoPortfolio_Tracker.ViewModels;
using System;
using Avalonia.Controls.Notifications;
using Ursa.Controls;
namespace CryptoPortfolio_Tracker.Views;
public partial class MainView : NavigationPage
{
public static MainView Current { get; set; } = null!;
private WindowToastManager _toastManager = null!;
public MainView()
{
InitializeComponent();
Current = this;
}
protected override async void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
_toastManager = new WindowToastManager(TopLevel.GetTopLevel(this));
if (CurrentPage == null)
await PushAsync(new LoginView()
{
DataContext = new LoginViewModel()
});
}
public void ShowToast(string message, NotificationType type)
{
_toastManager.Show(
content: message,
showIcon: true,
showClose: true,
type: type,
expiration: TimeSpan.FromSeconds(3),
classes: ["Light"]);
}
}