public RPlotHistoryVisualComponent(IRPlotManager plotManager, ICommandTarget controller, IVisualComponentContainer <IRPlotHistoryVisualComponent> container, ICoreShell coreShell)
        {
            if (plotManager == null)
            {
                throw new ArgumentNullException(nameof(plotManager));
            }

            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }

            if (coreShell == null)
            {
                throw new ArgumentNullException(nameof(coreShell));
            }

            _plotManager = plotManager;
            _viewModel   = new RPlotHistoryViewModel(plotManager, coreShell);
            _shell       = coreShell;

            var control = new RPlotHistoryControl {
                DataContext = _viewModel
            };

            _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>()
                             .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested);

            control.ContextMenuRequested += Control_ContextMenuRequested;

            Control    = control;
            Controller = controller;
            Container  = container;
        }
        public RPlotHistoryVisualComponent(IRPlotManager plotManager, ICommandTarget controller, IVisualComponentContainer<IRPlotHistoryVisualComponent> container, ICoreShell coreShell) {
            if (plotManager == null) {
                throw new ArgumentNullException(nameof(plotManager));
            }

            if (container == null) {
                throw new ArgumentNullException(nameof(container));
            }

            if (coreShell == null) {
                throw new ArgumentNullException(nameof(coreShell));
            }

            _plotManager = plotManager;
            _viewModel = new RPlotHistoryViewModel(plotManager, coreShell);
            _shell = coreShell;

            var control = new RPlotHistoryControl {
                DataContext = _viewModel
            };

            _disposableBag = DisposableBag.Create<RPlotDeviceVisualComponent>()
                .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested);

            control.ContextMenuRequested += Control_ContextMenuRequested;

            Control = control;
            Controller = controller;
            Container = container;
        }
Esempio n. 3
0
        public RPlotHistoryVisualComponent(IRPlotManager plotManager, IVisualComponentContainer <IRPlotHistoryVisualComponent> container, IServiceContainer services)
        {
            Check.ArgumentNull(nameof(plotManager), plotManager);
            Check.ArgumentNull(nameof(container), container);
            Check.ArgumentNull(nameof(services), services);

            var control = new RPlotHistoryControl();

            _viewModel          = new RPlotHistoryViewModel(control, plotManager, services.MainThread());
            control.DataContext = _viewModel;

            _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>()
                             .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested);

            control.ContextMenuRequested += Control_ContextMenuRequested;

            Control   = control;
            Container = container;
        }