From fc01423840c12ad6dad8e6a1c6b701c686812024 Mon Sep 17 00:00:00 2001 From: syneffort Date: Mon, 20 May 2024 16:03:19 +0900 Subject: [PATCH] oxyplot by PlotModel --- OxyPlotExample/GettingStarted/App.xaml | 9 ++++++ OxyPlotExample/GettingStarted/App.xaml.cs | 14 ++++++++++ OxyPlotExample/GettingStarted/AssemblyInfo.cs | 10 +++++++ .../GettingStarted/GettingStarted.csproj | 16 +++++++++++ OxyPlotExample/GettingStarted/MainWindow.xaml | 13 +++++++++ .../GettingStarted/MainWindow.xaml.cs | 24 ++++++++++++++++ .../ViewModels/MainViewModel.cs | 23 +++++++++++++++ .../GettingStarted/Views/MainView.xaml | 20 +++++++++++++ .../GettingStarted/Views/MainView.xaml.cs | 28 +++++++++++++++++++ OxyPlotExample/OxyPlotExample.sln | 25 +++++++++++++++++ OxyPlotExample/OxyPlotExample/App.xaml | 9 ++++++ OxyPlotExample/OxyPlotExample/App.xaml.cs | 14 ++++++++++ OxyPlotExample/OxyPlotExample/AssemblyInfo.cs | 10 +++++++ OxyPlotExample/OxyPlotExample/MainWindow.xaml | 12 ++++++++ .../OxyPlotExample/MainWindow.xaml.cs | 24 ++++++++++++++++ .../OxyPlotExample/OxyPlotExample.csproj | 11 ++++++++ 16 files changed, 262 insertions(+) create mode 100644 OxyPlotExample/GettingStarted/App.xaml create mode 100644 OxyPlotExample/GettingStarted/App.xaml.cs create mode 100644 OxyPlotExample/GettingStarted/AssemblyInfo.cs create mode 100644 OxyPlotExample/GettingStarted/GettingStarted.csproj create mode 100644 OxyPlotExample/GettingStarted/MainWindow.xaml create mode 100644 OxyPlotExample/GettingStarted/MainWindow.xaml.cs create mode 100644 OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs create mode 100644 OxyPlotExample/GettingStarted/Views/MainView.xaml create mode 100644 OxyPlotExample/GettingStarted/Views/MainView.xaml.cs create mode 100644 OxyPlotExample/OxyPlotExample.sln create mode 100644 OxyPlotExample/OxyPlotExample/App.xaml create mode 100644 OxyPlotExample/OxyPlotExample/App.xaml.cs create mode 100644 OxyPlotExample/OxyPlotExample/AssemblyInfo.cs create mode 100644 OxyPlotExample/OxyPlotExample/MainWindow.xaml create mode 100644 OxyPlotExample/OxyPlotExample/MainWindow.xaml.cs create mode 100644 OxyPlotExample/OxyPlotExample/OxyPlotExample.csproj diff --git a/OxyPlotExample/GettingStarted/App.xaml b/OxyPlotExample/GettingStarted/App.xaml new file mode 100644 index 0000000..210eaf7 --- /dev/null +++ b/OxyPlotExample/GettingStarted/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/OxyPlotExample/GettingStarted/App.xaml.cs b/OxyPlotExample/GettingStarted/App.xaml.cs new file mode 100644 index 0000000..c2747ec --- /dev/null +++ b/OxyPlotExample/GettingStarted/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace GettingStarted +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/OxyPlotExample/GettingStarted/AssemblyInfo.cs b/OxyPlotExample/GettingStarted/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/OxyPlotExample/GettingStarted/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/OxyPlotExample/GettingStarted/GettingStarted.csproj b/OxyPlotExample/GettingStarted/GettingStarted.csproj new file mode 100644 index 0000000..80096b0 --- /dev/null +++ b/OxyPlotExample/GettingStarted/GettingStarted.csproj @@ -0,0 +1,16 @@ + + + + WinExe + net6.0-windows + enable + enable + true + + + + + + + + diff --git a/OxyPlotExample/GettingStarted/MainWindow.xaml b/OxyPlotExample/GettingStarted/MainWindow.xaml new file mode 100644 index 0000000..f4d94a1 --- /dev/null +++ b/OxyPlotExample/GettingStarted/MainWindow.xaml @@ -0,0 +1,13 @@ + + + diff --git a/OxyPlotExample/GettingStarted/MainWindow.xaml.cs b/OxyPlotExample/GettingStarted/MainWindow.xaml.cs new file mode 100644 index 0000000..1f1a3fc --- /dev/null +++ b/OxyPlotExample/GettingStarted/MainWindow.xaml.cs @@ -0,0 +1,24 @@ +using System.Text; +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 +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..6596d6c --- /dev/null +++ b/OxyPlotExample/GettingStarted/ViewModels/MainViewModel.cs @@ -0,0 +1,23 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using OxyPlot; +using OxyPlot.Series; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GettingStarted.ViewModels +{ + public partial class MainViewModel : ObservableObject + { + [ObservableProperty] + private PlotModel _myModel; + + public MainViewModel() + { + MyModel = new PlotModel() { Title = "Getting Started" }; + MyModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)")); + } + } +} diff --git a/OxyPlotExample/GettingStarted/Views/MainView.xaml b/OxyPlotExample/GettingStarted/Views/MainView.xaml new file mode 100644 index 0000000..c05b2ae --- /dev/null +++ b/OxyPlotExample/GettingStarted/Views/MainView.xaml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/OxyPlotExample/GettingStarted/Views/MainView.xaml.cs b/OxyPlotExample/GettingStarted/Views/MainView.xaml.cs new file mode 100644 index 0000000..32d8205 --- /dev/null +++ b/OxyPlotExample/GettingStarted/Views/MainView.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 +{ + /// + /// MainView.xaml에 대한 상호 작용 논리 + /// + public partial class MainView : Page + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/OxyPlotExample/OxyPlotExample.sln b/OxyPlotExample/OxyPlotExample.sln new file mode 100644 index 0000000..bdeb079 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted", "GettingStarted\GettingStarted.csproj", "{8319F2C0-883D-484E-9745-CA2379A14C49}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8319F2C0-883D-484E-9745-CA2379A14C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8319F2C0-883D-484E-9745-CA2379A14C49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8319F2C0-883D-484E-9745-CA2379A14C49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8319F2C0-883D-484E-9745-CA2379A14C49}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D0EFDA27-685F-442A-AF95-66086C9F9AF2} + EndGlobalSection +EndGlobal diff --git a/OxyPlotExample/OxyPlotExample/App.xaml b/OxyPlotExample/OxyPlotExample/App.xaml new file mode 100644 index 0000000..d9cb7a0 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/OxyPlotExample/OxyPlotExample/App.xaml.cs b/OxyPlotExample/OxyPlotExample/App.xaml.cs new file mode 100644 index 0000000..a4a9252 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace OxyPlotExample +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/OxyPlotExample/OxyPlotExample/AssemblyInfo.cs b/OxyPlotExample/OxyPlotExample/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/OxyPlotExample/OxyPlotExample/MainWindow.xaml b/OxyPlotExample/OxyPlotExample/MainWindow.xaml new file mode 100644 index 0000000..f237fae --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/MainWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/OxyPlotExample/OxyPlotExample/MainWindow.xaml.cs b/OxyPlotExample/OxyPlotExample/MainWindow.xaml.cs new file mode 100644 index 0000000..a38e180 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/MainWindow.xaml.cs @@ -0,0 +1,24 @@ +using System.Text; +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 OxyPlotExample +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/OxyPlotExample/OxyPlotExample/OxyPlotExample.csproj b/OxyPlotExample/OxyPlotExample/OxyPlotExample.csproj new file mode 100644 index 0000000..18b9a12 --- /dev/null +++ b/OxyPlotExample/OxyPlotExample/OxyPlotExample.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net6.0-windows + enable + enable + true + + +