8
Source/Examples/WPF/SimpleDemo/App.xaml
Normal file
8
Source/Examples/WPF/SimpleDemo/App.xaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="SimpleDemo.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
25
Source/Examples/WPF/SimpleDemo/App.xaml.cs
Normal file
25
Source/Examples/WPF/SimpleDemo/App.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="App.xaml.cs" company="OxyPlot">
|
||||
// Copyright (c) 2014 OxyPlot contributors
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Interaction logic for App.xaml
|
||||
// </summary>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace SimpleDemo
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
59
Source/Examples/WPF/SimpleDemo/MainViewModel.cs
Normal file
59
Source/Examples/WPF/SimpleDemo/MainViewModel.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="MainViewModel.cs" company="OxyPlot">
|
||||
// Copyright (c) 2014 OxyPlot contributors
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Represents the view-model for the main window.
|
||||
// </summary>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace SimpleDemo
|
||||
{
|
||||
using OxyPlot;
|
||||
using OxyPlot.Series;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the view-model for the main window.
|
||||
/// </summary>
|
||||
public class MainViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MainViewModel" /> class.
|
||||
/// </summary>
|
||||
public MainViewModel()
|
||||
{
|
||||
// Create the plot model
|
||||
var tmp = new PlotModel { Title = "Simple example", Subtitle = "using OxyPlot" };
|
||||
|
||||
// Create two line series (markers are hidden by default)
|
||||
var series1 = new LineSeries { Title = "Series 1", MarkerType = MarkerType.Circle };
|
||||
series1.Points.Add(new DataPoint(0, 0));
|
||||
series1.Points.Add(new DataPoint(10, 18));
|
||||
series1.Points.Add(new DataPoint(20, 12));
|
||||
series1.Points.Add(new DataPoint(30, 8));
|
||||
series1.Points.Add(new DataPoint(40, 15));
|
||||
|
||||
var series2 = new LineSeries { Title = "Series 2", MarkerType = MarkerType.Square };
|
||||
series2.Points.Add(new DataPoint(0, 4));
|
||||
series2.Points.Add(new DataPoint(10, 12));
|
||||
series2.Points.Add(new DataPoint(20, 16));
|
||||
series2.Points.Add(new DataPoint(30, 25));
|
||||
series2.Points.Add(new DataPoint(40, 5));
|
||||
|
||||
|
||||
// Add the series to the plot model
|
||||
tmp.Series.Add(series1);
|
||||
tmp.Series.Add(series2);
|
||||
|
||||
// Axes are created automatically if they are not defined
|
||||
|
||||
// Set the Model property, the INotifyPropertyChanged event will make the WPF Plot control update its content
|
||||
this.Model = tmp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the plot model.
|
||||
/// </summary>
|
||||
public PlotModel Model { get; private set; }
|
||||
}
|
||||
}
|
||||
14
Source/Examples/WPF/SimpleDemo/MainWindow.xaml
Normal file
14
Source/Examples/WPF/SimpleDemo/MainWindow.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Window x:Class="SimpleDemo.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
|
||||
xmlns:simpleDemo="clr-namespace:SimpleDemo"
|
||||
Title="OxyPlot SimpleDemo" Height="480" Width="640">
|
||||
<Window.DataContext>
|
||||
<simpleDemo:MainViewModel />
|
||||
</Window.DataContext>
|
||||
<Grid>
|
||||
<!-- The OxyPlot control is binding to a PlotModel in the MainViewModel -->
|
||||
<oxy:PlotView Model="{Binding Model}" />
|
||||
</Grid>
|
||||
</Window>
|
||||
25
Source/Examples/WPF/SimpleDemo/MainWindow.xaml.cs
Normal file
25
Source/Examples/WPF/SimpleDemo/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="MainWindow.xaml.cs" company="OxyPlot">
|
||||
// Copyright (c) 2014 OxyPlot contributors
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Interaction logic for MainWindow.xaml
|
||||
// </summary>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace SimpleDemo
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MainWindow" /> class.
|
||||
/// </summary>
|
||||
public MainWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="AssemblyInfo.cs" company="OxyPlot">
|
||||
// Copyright (c) 2014 OxyPlot contributors
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
11
Source/Examples/WPF/SimpleDemo/SimpleDemo.csproj
Normal file
11
Source/Examples/WPF/SimpleDemo/SimpleDemo.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<UseWPF>true</UseWPF>
|
||||
<OutputType>WinExe</OutputType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\OxyPlot.Wpf\OxyPlot.Wpf.csproj" />
|
||||
<ProjectReference Include="..\..\..\OxyPlot\OxyPlot.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
3
Source/Examples/WPF/SimpleDemo/app.config
Normal file
3
Source/Examples/WPF/SimpleDemo/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||
Reference in New Issue
Block a user