diff --git a/OxyPlotExample/GettingStarted/MainWindow.xaml b/OxyPlotExample/GettingStarted/MainWindow.xaml
index 7fb12a8..63662fc 100644
--- a/OxyPlotExample/GettingStarted/MainWindow.xaml
+++ b/OxyPlotExample/GettingStarted/MainWindow.xaml
@@ -13,9 +13,11 @@
+
+
diff --git a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs
index 6596d6c..5184602 100644
--- a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs
+++ b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs
@@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
using OxyPlot;
using OxyPlot.Series;
using System;
@@ -6,6 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Timers;
+using System.Windows;
namespace GettingStarted.ViewModels
{
diff --git a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel2.cs b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel2.cs
index 436411f..0a75884 100644
--- a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel2.cs
+++ b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel2.cs
@@ -1,10 +1,12 @@
using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using System.Threading.Tasks;
+using System.Timers;
+using System.Windows;
namespace GettingStarted.ViewModels
{
@@ -22,12 +24,11 @@ namespace GettingStarted.ViewModels
Points = new List()
{
new DataPoint(0, 4),
- new DataPoint(10, 13),
- new DataPoint(20, 15),
- new DataPoint(30, 16),
- new DataPoint(40, 12),
- new DataPoint(50, 12)
-
+ new DataPoint(1, 13),
+ new DataPoint(2, 15),
+ new DataPoint(3, 16),
+ new DataPoint(4, 12),
+ new DataPoint(5, 12)
};
}
}
diff --git a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel3.cs b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel3.cs
new file mode 100644
index 0000000..7521d5c
--- /dev/null
+++ b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel3.cs
@@ -0,0 +1,67 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using OxyPlot.Series;
+using OxyPlot;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Timers;
+using System.Windows;
+
+namespace GettingStarted.ViewModels
+{
+ internal partial class MainViewModel3 : ObservableObject
+ {
+ [ObservableProperty]
+ private PlotModel _myModel;
+
+
+ [ObservableProperty]
+ private LineSeries _lineSeries;
+
+
+ public MainViewModel3()
+ {
+ MyModel = new PlotModel() { Title = "Getting Started with RT Plot" };
+ LineSeries = new LineSeries() { Title = "Dynamic Data" };
+
+ MyModel.Series.Add(LineSeries);
+
+ _timer = new System.Timers.Timer();
+ _timer.Interval = 50;
+ _timer.Elapsed -= _timer_Elapsed;
+ _timer.Elapsed += _timer_Elapsed;
+ }
+
+ private int _lastX = 0;
+ private void _timer_Elapsed(object? sender, ElapsedEventArgs e)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ LineSeries.Points.Add(new DataPoint(_lastX, Math.Sin(_lastX * 0.1)));
+ MyModel.InvalidatePlot(true);
+ _lastX++;
+ });
+ }
+
+ private bool _isTimerStarted = false;
+ private System.Timers.Timer _timer;
+
+ [RelayCommand]
+ private void FlipTimer()
+ {
+ if (!_isTimerStarted)
+ {
+ _timer.Start();
+ _isTimerStarted = true;
+ }
+ else
+ {
+ _timer.Stop();
+ _isTimerStarted = false;
+ }
+ }
+ }
+}
diff --git a/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml b/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml
new file mode 100644
index 0000000..d942813
--- /dev/null
+++ b/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml.cs b/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml.cs
new file mode 100644
index 0000000..b4c2bd6
--- /dev/null
+++ b/OxyPlotExample/GettingStarted/Views/MainViewControl3.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace GettingStarted.Views
+{
+ ///
+ /// MainViewControl3.xaml에 대한 상호 작용 논리
+ ///
+ public partial class MainViewControl3 : UserControl
+ {
+ public MainViewControl3()
+ {
+ InitializeComponent();
+ }
+ }
+}