public MainWindowViewModel() { this.defaultController = new PlotController(); this.Examples = ExampleLibrary.Examples.GetList(); this.ExamplesView = CollectionViewSource.GetDefaultView(this.Examples.OrderBy(e => e.Category)); this.ExamplesView.GroupDescriptions.Add(new PropertyGroupDescription("Category")); }
public MainWindowViewModel() { this.defaultController = new PlotController(); this.Examples = ExampleLibrary.Examples.GetList(); this.ExamplesView = CollectionViewSource.GetDefaultView(this.Examples.OrderBy(e => e.Category)); this.ExamplesView.GroupDescriptions.Add(new PropertyGroupDescription("Category")); }
private void CustomizeController(IPlotController controller) { controller.UnbindAll(); // actual changes to the controller controller.BindMouseDown(OxyMouseButton.Left, OxyModifierKeys.Shift, PlotCommands.ZoomRectangle); controller.BindMouseDown(OxyMouseButton.Left, OxyModifierKeys.Control, PlotCommands.PanAt); controller.BindMouseDown(OxyMouseButton.Left, PlotCommands.SnapTrack); controller.BindKeyDown(OxyKey.Home, PlotCommands.Reset); controller.BindMouseWheel(PlotCommands.ZoomWheel); controller.BindMouseWheel(OxyModifierKeys.Control, PlotCommands.ZoomWheelFine); }
public PlotViewModel(PlotValue plot, IVisualizer visualizer, IConsole console) { _controller = ControllerFactory.Create(plot); _console = new RelayCommand(_ => ShowConsole(console)); _settings = new RelayCommand(_ => ShowSettings(plot)); _series = new RelayCommand(_ => ShowSeries(plot)); _grid = new RelayCommand(_ => _controller.ToggleGrid()); _center = new RelayCommand(_ => _controller.CenterPlot()); _dock = new RelayCommand(_ => visualizer.Dock(this)); _undock = new RelayCommand(_ => visualizer.Undock()); _print = new RelayCommand(obj => Print(plot, obj as IPlotSerializer)); _save = new RelayCommand(obj => Save(plot, obj as IPlotSerializer)); }
/// <summary> /// Initializes a new instance of the <see cref="Plot" /> class. /// </summary> public Plot() { this.series = new ObservableCollection<Series>(); this.axes = new ObservableCollection<Axis>(); this.annotations = new ObservableCollection<Annotation>(); this.series.CollectionChanged += this.OnSeriesChanged; this.axes.CollectionChanged += this.OnAxesChanged; this.annotations.CollectionChanged += this.OnAnnotationsChanged; this.defaultController = new PlotController(); this.internalModel = new PlotModel(); ((IPlotModel)this.internalModel).AttachPlotView(this); }
/// <summary> /// Initializes a new instance of the <see cref="Plot" /> class. /// </summary> public Plot() { this.series = new ObservableCollection <Series>(); this.axes = new ObservableCollection <Axis>(); this.annotations = new ObservableCollection <Annotation>(); this.series.CollectionChanged += this.OnSeriesChanged; this.axes.CollectionChanged += this.OnAxesChanged; this.annotations.CollectionChanged += this.OnAnnotationsChanged; this.defaultController = new PlotController(); this.internalModel = new PlotModel(); ((IPlotModel)this.internalModel).AttachPlotView(this); }
/// <summary> /// Initializes a new instance of the <see cref="Plot" /> class. /// </summary> public Plot() { series = new ObservableCollection <Series>(); axes = new ObservableCollection <Axis>(); annotations = new ObservableCollection <Annotation>(); legends = new ObservableCollection <Legend>(); series.CollectionChanged += OnSeriesChanged; axes.CollectionChanged += OnAxesChanged; annotations.CollectionChanged += OnAnnotationsChanged; legends.CollectionChanged += this.OnAnnotationsChanged; defaultController = new PlotController(); internalModel = new PlotModel(); ((IPlotModel)internalModel).AttachPlotView(this); }
/// <summary> /// Initializes this instance if it is not already initialized. /// </summary> private void EnsureInitialized() { if (this.initialized) { return; } this.initialized = true; var result = this.GetResult(); if (result is PlotModel plotModel) { this.model = plotModel; } else if (result is Example example) { this.model = example.Model; this.plotController = example.Controller; } if (this.model?.IsTransposable() != true) { return; } var result2 = this.GetResult(); if (result2 is PlotModel plotModel2) { this.transposedModel = plotModel2.Transpose(); } else if (result2 is Example example2) { this.transposedModel = example2.Model.Transpose(); this.transposedPlotController = example2.Controller; } }
public Example(PlotModel model, IPlotController controller = null) { this.Model = model; this.Controller = controller; }
/// <summary> /// Initializes a new instance of the <see cref="Example"/> class. /// </summary> /// <param name="model">The model.</param> /// <param name="controller">The controller.</param> public Example(PlotModel model, IPlotController controller = null) { this.Model = model; this.Controller = controller; }
public PlotViewModel(PlotModel plot) { Plot = plot; PlotController = CreatePlotController(); }