/// <summary> /// Constructor /// </summary> /// <param name="chartPanel"></param> /// <param name="oldStatus"></param> /// <param name="newStatus"></param> public ChartPanelStatusChangedEventArgs(ChartPanel chartPanel, ChartStatus oldStatus, ChartStatus newStatus) { ChartPanel = chartPanel; OldStatus = oldStatus; NewStatus = newStatus; }
///<summary> /// Initializes a new instance of the <seealso cref="StockChartX"/> class. ///</summary> public StockChartX() { _isBeta = false; #if WPF Action <Application> a = application => { if (application != null) { OwnerWindow = application.MainWindow; } }; //RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); Application appCurrent = Application.Current; if (appCurrent != null) { if (appCurrent.CheckAccess()) { a(appCurrent); } else { appCurrent.Dispatcher.BeginInvoke(a, appCurrent); } } #endif #if SILVERLIGHT DefaultStyleKey = typeof(StockChartX); #endif _dataManager = new DataManager.DataManager(this); Background = Brushes.Black; Foreground = Brushes.White; _startIndex = _endIndex = 0; //no data. all panels' data are related to these indexes _darwasBoxes = false; _displatTitles = true; _useVolumeUpDownColors = false; _useLineSeriesColors = false; _horizontalLinesColor = Colors.White; _candleDownOutlineColor = null; _candleUpOutlineColor = null; _barSpacing = 0; _barInterval = 60; _barWidth = 1; _darvasPct = 0.01; _priceStyle = PriceStyleEnum.psStandard; _status = ChartStatus.Ready; YGridStepType = YGridStepType.MinimalGap; _timers.RegisterTimer(TimerMove, MoveChart, 50); _timers.RegisterTimer(TimerResize, ResizeChart, 50); _timers.RegisterTimer(TimerUpdate, Update, 50); _timers.RegisterTimer(TimerCrossHairs, MoveCrossHairs, 50); _timers.RegisterTimer(TimerInfoPanel, ShowInfoPanelInternal, 50); #if WPF MouseWheel += Chart_MouseWheel; #endif //initialize needed variables CheckRegistration(); #if SILVERLIGHT Mouse.RegisterMouseMoveAbleElement(this); MouseMove += (sender, e) => Mouse.UpdateMousePosition(this, e.GetPosition(this)); #endif }