/// <summary> /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { return; } this.plotImage = (PlotImage)this.GetTemplateChild(PartPlotImage); this.zoomRectangle = new ContentControl(); this.plotImage.Overlay.Children.Add(this.zoomRectangle); }
/// <summary> /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { return; } this.plotImage = this.GetTemplateChild(PartPlotImage) as PlotImage; this.zoomRectangle = new ContentControl(); this.plotImage.Overlay.Children.Add(this.zoomRectangle); }