Ejemplo n.º 1
0
        /// <summary>
        /// Assigns control template parts.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            _gridCanvas = (Canvas)TreeHelper.TemplateFindName("PART_GridCanvas", this);

            if (_pendingSetupLines)
            {
                SetupLines();
            }
        }
Ejemplo n.º 2
0
        private void AssignGraphCanvas()
        {
            _graphCanvasDecorator              = (Border)TreeHelper.TemplateFindName("PART_GraphCanvasDecorator", this);
            _graphCanvasDecorator.SizeChanged += new SizeChangedEventHandler(OnGraphCanvasDecoratorSizeChanged);
            _graphCanvas = (Canvas)TreeHelper.TemplateFindName("PART_GraphCanvas", this);

            _graphCanvas.PointerEntered += OnGraphCanvasPointerEntered;
            _graphCanvas.PointerMoved   += OnGraphCanvasPointerMoved;
            _graphCanvas.PointerExited  += OnGraphCanvasPointerExited;
        }
Ejemplo n.º 3
0
        private void AssignGridParts()
        {
            _valueAxis = (ValueAxis)TreeHelper.TemplateFindName("PART_ValueAxis", this);
            _valueGrid = (ValueGrid)TreeHelper.TemplateFindName("PART_ValueGrid", this);

            Binding formatBinding = new Binding();

            formatBinding.Path   = new PropertyPath("ValueFormatString");
            formatBinding.Source = this;
            _valueAxis.SetBinding(ValueAxis.ValueFormatStringProperty, formatBinding);

            _categoryAxis = (CategoryAxis)TreeHelper.TemplateFindName("PART_CategoryAxis", this);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Applies control template.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            _sliceCanvasDecorator              = (Border)TreeHelper.TemplateFindName("PART_SliceCanvasDecorator", this);
            _sliceCanvasDecorator.SizeChanged += new SizeChangedEventHandler(OnGraphCanvasDecoratorSizeChanged);
            _sliceCanvas = (Canvas)TreeHelper.TemplateFindName("PART_SliceCanvas", this);

            _balloon = (Balloon)TreeHelper.TemplateFindName("PART_Balloon", this);

            AddSlicesToCanvas();

            _legend = (Legend)TreeHelper.TemplateFindName("PART_Legend", this);

            UpdateLegend();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Finds object in control's template by it's name.
 /// </summary>
 /// <param name="name">Objects name.</param>
 /// <param name="templatedParent">Templated parent.</param>
 /// <returns>Object reference if found, null otherwise.</returns>
 public static object TemplateFindName(string name, FrameworkElement templatedParent)
 {
     for (int i = 0; i < VisualTreeHelper.GetChildrenCount(templatedParent); i++)
     {
         DependencyObject child = VisualTreeHelper.GetChild(templatedParent, i);
         if (child is FrameworkElement)
         {
             if (((FrameworkElement)child).Name == name)
             {
                 return(child);
             }
             else
             {
                 object subChild = TreeHelper.TemplateFindName(name, (FrameworkElement)child);
                 if (subChild != null && subChild is FrameworkElement && ((FrameworkElement)subChild).Name == name)
                 {
                     return(subChild);
                 }
             }
         }
     }
     return(null);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Applies control template.
 /// </summary>
 protected override void OnApplyTemplate()
 {
     _graphCanvas = (Canvas)TreeHelper.TemplateFindName("PART_GraphCanvas", this);
     _graphCanvas.Children.Add(_lineGraph);
 }
Ejemplo n.º 7
0
 private void AssignBalloon()
 {
     _balloon = (Balloon)TreeHelper.TemplateFindName("PART_Balloon", this);
 }
Ejemplo n.º 8
0
 private void AssignLegend()
 {
     _legend = (Legend)TreeHelper.TemplateFindName("PART_Legend", this);
     _legend.LegendItemsSource = this.Graphs.Cast <ILegendItem>(); // TODO: handle changes in Graphs
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Applies template.
 /// </summary>
 protected override void OnApplyTemplate()
 {
     _valuesPanel = (Canvas)TreeHelper.TemplateFindName("PART_ValuesPanel", this);
     _tickPanel   = (Canvas)TreeHelper.TemplateFindName("PART_TickPanel", this);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Applies control template.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            _sliceVisual = (Path)TreeHelper.TemplateFindName("PART_SliceVisual", this);

            RenderSlice();
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Assigns control template parts.
 /// </summary>
 protected override void OnApplyTemplate()
 {
     _gridCanvas = (Canvas)TreeHelper.TemplateFindName("PART_GridCanvas", this);
 }