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

            if (_pendingSetupLines)
            {
                SetupLines();
            }
        }
예제 #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;
        }
예제 #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);
        }
예제 #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();
        }
예제 #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);
 }
예제 #6
0
 /// <summary>
 /// Applies control template.
 /// </summary>
 protected override void OnApplyTemplate()
 {
     _graphCanvas = (Canvas)TreeHelper.TemplateFindName("PART_GraphCanvas", this);
     _graphCanvas.Children.Add(_lineGraph);
 }
예제 #7
0
 private void AssignBalloon()
 {
     _balloon = (Balloon)TreeHelper.TemplateFindName("PART_Balloon", this);
 }
예제 #8
0
 private void AssignLegend()
 {
     _legend = (Legend)TreeHelper.TemplateFindName("PART_Legend", this);
     _legend.LegendItemsSource = this.Graphs.Cast <ILegendItem>(); // TODO: handle changes in Graphs
 }
예제 #9
0
 /// <summary>
 /// Applies template.
 /// </summary>
 protected override void OnApplyTemplate()
 {
     _valuesPanel = (Canvas)TreeHelper.TemplateFindName("PART_ValuesPanel", this);
     _tickPanel   = (Canvas)TreeHelper.TemplateFindName("PART_TickPanel", this);
 }
예제 #10
0
        /// <summary>
        /// Applies control template.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            _sliceVisual = (Path)TreeHelper.TemplateFindName("PART_SliceVisual", this);

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