Add initial project structure with basic view models, views, and resources
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using Avalonia.Controls;
|
||||
using CryptoPortfolio_Tracker.Models;
|
||||
using CryptoPortfolio_Tracker.ViewModels;
|
||||
using Ursa.Controls;
|
||||
|
||||
namespace CryptoPortfolio_Tracker.Views;
|
||||
|
||||
public partial class HomeView : ContentPage
|
||||
{
|
||||
public HomeView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CryptoTable_OnSelectionChanged(
|
||||
object? sender,
|
||||
SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is not TableView tableView)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tableView.SelectedItem is not Cryptocurrency cryptocurrency)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CryptoChartViewModel viewModel =
|
||||
new(cryptocurrency);
|
||||
|
||||
tableView.SelectedIndex = -1;
|
||||
|
||||
_ = OverlayDialog.ShowCustomAsync<
|
||||
CryptoChartView,
|
||||
CryptoChartViewModel,
|
||||
object>(
|
||||
viewModel,
|
||||
null,
|
||||
new OverlayDialogOptions
|
||||
{
|
||||
Title = cryptocurrency.Name,
|
||||
CanDragMove = true,
|
||||
CanResize = true,
|
||||
CanLightDismiss = true,
|
||||
IsCloseButtonVisible = true,
|
||||
HorizontalScrollBarVisibility =
|
||||
Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
|
||||
VerticalScrollBarVisibility =
|
||||
Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
|
||||
Buttons = DialogButton.None,
|
||||
StyleClass = "CryptoChartDialog"
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user