PlotView.xaml
<Button Content="<<" Height="23" HorizontalAlignment="Right" Name="button2" VerticalAlignment="Center" Width="30" Click="button2_Click" Margin="0,0,40,0"/>
PlotView.xaml.cs
private int SelectedBarNo = -1;
private void button2_Click(object sender, RoutedEventArgs
e)
{
PlotViewModel pvm = this.DataContext as
PlotViewModel;
SelectedBarNo =
-1;
if
(pvm !=
null)
{
pvm.BarNo =
SelectedBarNo;
pvm.SetInfo(SelectedBarNo);
}
tChart1.Page.Previous();
if (tChart1.Series.Count >
0)
tChart1.Series[0].Repaint();
}
PlotViewModel.cs
#region 设置info信息
public
void SetInfo(int BarNo)
{
.....
}
在MainView.xaml
<DataTemplate DataType="{x:Type
local:PlotViewModel}"
x:Key="PlotTemplate">
<local:PlotView AxesStyle="{Binding Axes, Mode=TwoWay}"
PaintLine="{Binding Paint,
Mode=TwoWay}" />
</DataTemplate>