private void AssignLegend() { _legend = (Legend)TreeHelper.TemplateFindName("PART_Legend", this); _legend.LegendItemsSource = this.Graphs.Cast<ILegendItem>(); // TODO: handle changes in Graphs #if WINDOWS_PHONE _legend.ManipulationStarted += new EventHandler<ManipulationStartedEventArgs>(OnGridManipulationStarted); #endif }
/// <summary> /// Applies control template. /// </summary> public 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); #if WINDOWS_PHONE _legend.ManipulationStarted += new EventHandler<ManipulationStartedEventArgs>(OnLegendManipulationStarted); #endif UpdateLegend(); }