public HDynamicRuler( IHDynamicRulerEventBroker dynamicRulerEventBroker) { LineOpacity = 0.5; InitializeComponent(); dynamicRulerEventBroker.ShowRuler += ShowDynamicRuler; dynamicRulerEventBroker.HideRuler += HideDynamicRuler; _updateRulerObservable = Observable .FromEventPattern<DynamicRulerChangedEventArgs>(dynamicRulerEventBroker, "UpdateRuler") .ObserveOn(SynchronizationContext.Current) .Subscribe(evt => UpdateDynamicRuler(evt.EventArgs)); HideDynamicRuler(); }
public TimeScale( TimeAxis timeAxis, IHDynamicRulerEventBroker dynamicRulerEventBroker, HStepHelper hStepHelper, IOnlineMode onlineMode) { _timeAxis = timeAxis; _timeAxis.BoundsChanged += (s, e) => UpdateSectionLabels(); _timeAxis.BoundsChanged += (s, e) => UpdateDynamicRulerLabel(); _hStepHelper = hStepHelper; _hStepHelper.StepsChanged += (s, e) => { CreateSectionLabels(); UpdateSectionLabels(); }; _onlineMode = onlineMode; _onlineMode.IsOnlineChanged += (s, e) => OnPropertyChanged("IsInOfflineMode"); IntervalLeftCommand = new RelayCommand(IntervalLeft); IntervalRightCommand = new RelayCommand(IntervalRight); InitializeComponent(); MouseEnter += (s, e) => UpdateVisualStates(); MouseLeave += (s, e) => UpdateVisualStates(); var uiMoveHelper = new UiMoveHelper(MoveScaleSurface, Cursors.ScrollWE, onlineMode); uiMoveHelper.Moved += uiMoveHelper_Moved; var scaleZoomHelper = new ScaleZoomHelper(MoveScaleSurface, true); scaleZoomHelper.Scrolled += scaleZoomHelper_Scrolled; dynamicRulerEventBroker.ShowRuler += ShowDynamicRulerLabel; dynamicRulerEventBroker.HideRuler += HideDynamicRulerLabel; _updateRulerObservable = Observable .FromEventPattern<DynamicRulerChangedEventArgs>(dynamicRulerEventBroker, "UpdateRuler") .ObserveOn(SynchronizationContext.Current) .Subscribe(evt => UpdateDynamicRuler(evt.EventArgs)); CreateSectionLabels(); UpdateSectionLabels(); }