@@ -0,0 +1,17 @@
|
||||
using OxyPlot;
|
||||
|
||||
namespace PlotModelAlreadyInUse
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
public Item(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Model = new PlotModel();
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public PlotModel Model { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<Window x:Class="PlotModelAlreadyInUse.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:PlotModelAlreadyInUse"
|
||||
xmlns:oxy="http://oxyplot.org/wpf"
|
||||
mc:Ignorable="d"
|
||||
Title="PlotModel already in use" Height="350" Width="525">
|
||||
<Window.DataContext>
|
||||
<local:ViewModel/>
|
||||
</Window.DataContext>
|
||||
<Grid>
|
||||
<DataGrid ItemsSource="{Binding Items}" AutoGenerateColumns="False">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||
</DataGrid.Columns>
|
||||
|
||||
<DataGrid.RowDetailsTemplate>
|
||||
<DataTemplate>
|
||||
<oxy:PlotView Model="{Binding Model}" Height="200"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowDetailsTemplate>
|
||||
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace PlotModelAlreadyInUse
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
[WpfExamples.Example("PlotModel already in use")]
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace PlotModelAlreadyInUse
|
||||
{
|
||||
public class ViewModel
|
||||
{
|
||||
public ViewModel()
|
||||
{
|
||||
Items = new ObservableCollection<Item>();
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
Items.Add(new Item("MyName " + i));
|
||||
}
|
||||
|
||||
public ObservableCollection<Item> Items { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user