118 lines
4.5 KiB
XML
118 lines
4.5 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
|
|
xmlns:vm="using:CryptoPortfolio_Tracker.ViewModels"
|
|
xmlns:u="https://irihi.tech/ursa"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
d:DesignWidth="900" d:DesignHeight="600"
|
|
x:Class="CryptoPortfolio_Tracker.Views.CryptoChartView"
|
|
x:DataType="vm:CryptoChartViewModel">
|
|
|
|
<Border Background="#232429"
|
|
CornerRadius="14"
|
|
Padding="20">
|
|
|
|
<Grid RowDefinitions="Auto,Auto,*,Auto"
|
|
RowSpacing="15">
|
|
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Spacing="3">
|
|
<TextBlock Text="{Binding CryptocurrencyName}"
|
|
FontSize="24"
|
|
FontWeight="Bold" />
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
Spacing="8">
|
|
|
|
<TextBlock Text="{Binding CurrentPrice, StringFormat='{}{0:N2} $'}"
|
|
FontSize="20"
|
|
FontWeight="SemiBold" />
|
|
|
|
<TextBlock Text="{Binding PriceChangePercentage24H, StringFormat='{}{0:+0.00;-0.00;0.00} %'}"
|
|
Classes.Success="{Binding IsPositive}"
|
|
Classes.Danger="{Binding IsNegative}"
|
|
FontSize="16"
|
|
VerticalAlignment="Center" />
|
|
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="1"
|
|
ColumnDefinitions="Auto,Auto,Auto"
|
|
ColumnSpacing="25">
|
|
|
|
<StackPanel Spacing="2">
|
|
<TextBlock Text="Изменение"
|
|
FontSize="12"
|
|
Opacity="0.6" />
|
|
|
|
<TextBlock Text="{Binding PriceChange24H, StringFormat='{}{0:+0.00;-0.00;0.00} $'}"
|
|
Classes.Success="{Binding IsPositive}"
|
|
Classes.Danger="{Binding IsNegative}"
|
|
FontWeight="SemiBold" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
Spacing="2">
|
|
|
|
<TextBlock Text="Рыночная капитализация"
|
|
FontSize="12"
|
|
Opacity="0.6" />
|
|
|
|
<TextBlock Text="{Binding MarketCap, StringFormat='{}{0:N0} $'}"
|
|
FontWeight="SemiBold" />
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="2"
|
|
Spacing="2">
|
|
|
|
<TextBlock Text="Объём за 24ч"
|
|
FontSize="12"
|
|
Opacity="0.6" />
|
|
|
|
<TextBlock Text="{Binding Volume24H, StringFormat='{}{0:N0} $'}"
|
|
FontWeight="SemiBold" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<lvc:CartesianChart
|
|
Grid.Row="2"
|
|
MinHeight="400"
|
|
LegendPosition="Hidden"
|
|
TooltipPosition="Top"
|
|
FindingStrategy="CompareOnlyX"
|
|
ZoomMode="X"
|
|
AnimationsSpeed="0"
|
|
DrawMarginFrame="{x:Null}"
|
|
Series="{Binding Series}">
|
|
|
|
<lvc:CartesianChart.XAxes>
|
|
<lvc:XamlDateTimeAxis
|
|
UnitWidth="{Binding UnitWidth}"
|
|
Interval="01:00:00"
|
|
DateFormatter="{Binding DateFormatter}"
|
|
SeparatorsPaint="{Binding GridPaint}" />
|
|
</lvc:CartesianChart.XAxes>
|
|
|
|
<lvc:CartesianChart.YAxes>
|
|
<lvc:XamlAxis
|
|
Labeler="{Binding PriceFormatter}"
|
|
SeparatorsPaint="{Binding GridPaint}" />
|
|
</lvc:CartesianChart.YAxes>
|
|
|
|
</lvc:CartesianChart>
|
|
|
|
<TextBlock
|
|
Grid.Row="3"
|
|
Text="Колесо мыши — масштабирование • Перетаскивание — перемещение"
|
|
FontSize="12"
|
|
Opacity="0.5"
|
|
HorizontalAlignment="Center" />
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
</UserControl> |