Example #1
0
 private void OnLocationChanged()
 {
     EdgePanel.SetEdge((UIElement)this.GetAxisPanel(AxisPresenter.AxisPanelType.AxisAndTickMarks), this.ActualLocation);
     EdgePanel.SetEdge((UIElement)this.GetAxisPanel(AxisPresenter.AxisPanelType.Labels), this.ActualLocation);
     EdgePanel.SetEdge((UIElement)this.GetAxisPanel(AxisPresenter.AxisPanelType.Title), this.ActualLocation);
     EdgePanel.SetEdge((UIElement)this.GetAxisPanel(AxisPresenter.AxisPanelType.DisplayUnit), this.ActualLocation);
     this.OnPropertyChanged("ActualLocation");
 }
Example #2
0
 public override void OnApplyTemplate()
 {
     if (this.ChartAreaPanel != null)
     {
         this.ChartAreaPanel.ArrangeComplete -= new EventHandler(this.ChartArea_ArrangeComplete);
     }
     base.OnApplyTemplate();
     this.ChartAreaPanel = this.GetTemplateChild("ChartAreaCanvas") as EdgePanel;
     if (this.ChartAreaPanel != null)
     {
         this._chartAreaLayersProvider.ParentPanel = (Panel)this.ChartAreaPanel;
         this.ChartAreaPanel.ChartArea             = this;
         this.ChartAreaPanel.SetBinding(EdgePanel.CenterMarginProperty, (BindingBase) new Binding("PlotAreaMargin")
         {
             Source = (object)this
         });
         this.SetBinding(ChartArea.ActualPlotAreaMarginProperty, (BindingBase) new Binding("ActualCenterMargin")
         {
             Source = (object)this.ChartAreaPanel
         });
         this.PlotAreaPanel = (Grid)this._chartAreaLayersProvider.GetLayer((object)LayerType.PlotArea, 100, (Func <Panel>)(() => (Panel) new Grid()));
         this.PlotAreaPanel.SetBinding(FrameworkElement.StyleProperty, (BindingBase) new Binding("PlotAreaStyle")
         {
             Source = (object)this
         });
         this.PlotAreaPanel.Background = (Brush) new SolidColorBrush(Color.FromArgb((byte)1, byte.MaxValue, byte.MaxValue, byte.MaxValue));
         EdgePanel.SetEdge((UIElement)this.PlotAreaPanel, Edge.Center);
         this._plotAreaLayersProvider.ParentPanel = (Panel)this.PlotAreaPanel;
         this.InitializeWatermark();
         this.ChartAreaPanel.ArrangeComplete     += new EventHandler(this.ChartArea_ArrangeComplete);
         this.ChartAreaPanel.MouseWheel          += new MouseWheelEventHandler(this.ChartAreaPanel_MouseWheel);
         this.ChartAreaPanel.MouseLeftButtonDown += new MouseButtonEventHandler(this.ChartAreaPanel_MouseLeftButtonDown);
         this.ChartAreaPanel.MouseLeftButtonUp   += new MouseButtonEventHandler(this.ChartAreaPanel_MouseLeftButtonUp);
         this.ChartAreaPanel.MouseMove           += new MouseEventHandler(this.ChartAreaPanel_MouseMove);
         this.MouseClickHelper = new MouseClickHelper(new Action <object, MouseButtonEventArgs>(this.OnMouseSingleClick), new Action <object, MouseButtonEventArgs>(this.OnMouseDoubleClick), new TimeSpan?());
         this.MouseClickHelper.Attach((UIElement)this.ChartAreaPanel);
         Grid grid = this.GetTemplateChild("LayoutRoot") as Grid;
         if (grid != null)
         {
             this.SelectionPanel = new SelectionPanel(this);
             grid.Children.Add((UIElement)this.SelectionPanel);
         }
     }
     if (!this._isTemplateApplied)
     {
         this._isTemplateApplied = true;
     }
     this.UpdateSession.DisableUpdates = false;
     this.ResetView();
 }