-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathLiveCharts2ViewModel.cs
More file actions
28 lines (22 loc) · 682 Bytes
/
LiveCharts2ViewModel.cs
File metadata and controls
28 lines (22 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace WinUICsMarkupExamples.Presentation.Example;
public partial class LiveCharts2ViewModel(INavigator navigator) : BaseViewModel
{
public ISeries[] SeriesCollection { get; set; } = [
new LineSeries<int>(Fetch())
];
static int[] Fetch()
{
var values = new int[100];
var r = new Random();
var t = 0;
for (var i = 0; i < 100; i++)
{
t += r.Next(-90, 100);
values[i] = t;
}
return values;
}
[RelayCommand] public async Task Forward() => await navigator.NavigateViewModelAsync<ScottPlotViewModel>(this);
}