55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
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"
|
|
});
|
|
}
|
|
} |