DrawingText.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. using MuchInfo.Chart.Data;
  2. using MuchInfo.Chart.Data.EnumTypes;
  3. using MuchInfo.Chart.Infrastructure.Helpers;
  4. using MuchInfo.Chart.Infrastructure.Utilities;
  5. using MuchInfo.Chart.WPF.Controls.Editors;
  6. using MuchInfo.Chart.WPF.Controls.Utilities;
  7. using MuchInfo.Chart.WPF.Helpers;
  8. using MuchInfo.Chart.WPF.Primitives.Interfaces;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Windows;
  12. using System.Windows.Controls;
  13. using System.Windows.Controls.Primitives;
  14. using System.Windows.Input;
  15. using System.Windows.Media;
  16. using System.Xml.Linq;
  17. namespace MuchInfo.Chart.WPF.Primitives.Drawing
  18. {
  19. public sealed class DrawingText : Drawing1PointBase
  20. {
  21. #region Fields
  22. private bool _flag;
  23. private double _fontSize;
  24. private bool _isMouseDown;
  25. private Border _labelBoder;
  26. private Popup _popup;
  27. private Point _position;
  28. //鼠标移到上面时记录上次画线工具
  29. private IDrawingTool _preDrawingTool;
  30. private string _text;
  31. #endregion Fields
  32. #region Constructors
  33. /// <summary>
  34. /// Initializes a new instance of the <see cref="DrawingText"/> class.
  35. /// </summary>
  36. public DrawingText()
  37. {
  38. this._text = LanguageManager.FindResource(LanguageConst.DrawingTool_Edit_DefaultText);
  39. this._fontSize = 12;
  40. this._isMouseDown = false;
  41. }
  42. #endregion Constructors
  43. #region Properties
  44. #region Public Properties
  45. /// <summary>
  46. /// Gets or sets the size of the font.
  47. /// </summary>
  48. public double FontSize
  49. {
  50. get
  51. {
  52. return this._fontSize;
  53. }
  54. set
  55. {
  56. var flag = !this._fontSize.Equals(value);
  57. if (flag)
  58. {
  59. this._fontSize = value;
  60. this.Label.FontSize = (this._fontSize);
  61. //this.PropertyChanged();
  62. }
  63. }
  64. }
  65. /// <summary>
  66. /// Gets or sets a value indicating whether this instance is remove click.
  67. /// </summary>
  68. public bool IsRemoveClick
  69. {
  70. get;
  71. set;
  72. }
  73. /// <summary>
  74. /// 获取和设置the label
  75. /// </summary>
  76. public TextBlock Label
  77. {
  78. get;
  79. set;
  80. }
  81. /// <summary>
  82. /// 获取和设置the label border
  83. /// </summary>
  84. public Border LabelBorder
  85. {
  86. get
  87. {
  88. return this._labelBoder;
  89. }
  90. set
  91. {
  92. var mouseMove = new MouseEventHandler(this.LabelBoder_MouseMove);
  93. var mouseLeftButtonUp = new MouseButtonEventHandler(this.LabelBoder_MouseLeftButtonUp);
  94. var lostMouseCapture = new MouseEventHandler(this.LabelBoder_LostMouseCapture);
  95. var mouseButtonEventHandler2 = new MouseButtonEventHandler(this.LabelBoder_MouseLeftButtonDown);
  96. var mouseLeave = new MouseEventHandler(this.LabelBoder_MouseLeave);
  97. var mouseEnter = new MouseEventHandler(this.LabelBoder_MouseEnter);
  98. var mouseRightButtonUp = new MouseButtonEventHandler(this.LabelBoder_MouseRightButtonUp);
  99. bool flag = this._labelBoder != null;
  100. if (flag)
  101. {
  102. this._labelBoder.MouseMove -= (mouseMove);
  103. this._labelBoder.MouseLeftButtonUp -= (mouseLeftButtonUp);
  104. this._labelBoder.LostMouseCapture -= (lostMouseCapture);
  105. this._labelBoder.MouseLeftButtonDown -= (mouseButtonEventHandler2);
  106. this._labelBoder.MouseRightButtonUp -= (mouseRightButtonUp);
  107. this._labelBoder.MouseLeave -= (mouseLeave);
  108. this._labelBoder.MouseEnter -= (mouseEnter);
  109. }
  110. this._labelBoder = value;
  111. flag = (this._labelBoder != null);
  112. if (flag)
  113. {
  114. this._labelBoder.MouseMove += (mouseMove);
  115. this._labelBoder.MouseLeftButtonUp += (mouseLeftButtonUp);
  116. this._labelBoder.LostMouseCapture += (lostMouseCapture);
  117. this._labelBoder.MouseLeftButtonDown += (mouseButtonEventHandler2);
  118. this._labelBoder.MouseRightButtonUp += (mouseRightButtonUp);
  119. this._labelBoder.MouseLeave += (mouseLeave);
  120. this._labelBoder.MouseEnter += (mouseEnter);
  121. }
  122. }
  123. }
  124. /// <summary>
  125. /// 获取和设置the popup
  126. /// </summary>
  127. public Popup Popup
  128. {
  129. get
  130. {
  131. return this._popup;
  132. }
  133. set
  134. {
  135. var eventHandler = new EventHandler(this.Popup_Closed);
  136. bool flag = this._popup != null;
  137. if (flag)
  138. {
  139. this._popup.Closed -= (eventHandler);
  140. }
  141. this._popup = value;
  142. flag = (this._popup != null);
  143. if (flag)
  144. {
  145. this._popup.Closed += (eventHandler);
  146. }
  147. }
  148. }
  149. /// <summary>
  150. /// Gets the name of the root.
  151. /// </summary>
  152. public override string RootName
  153. {
  154. get
  155. {
  156. return "DrawText";
  157. }
  158. }
  159. /// <summary>
  160. /// 获取和设置the text
  161. /// </summary>
  162. public string Text
  163. {
  164. get
  165. {
  166. return this._text;
  167. }
  168. set
  169. {
  170. if (!_text.Equals(value))
  171. {
  172. this._text = value;
  173. this.Label.Text = this._text;
  174. //this.PropertyChanged();
  175. }
  176. }
  177. }
  178. #endregion Public Properties
  179. #region Internal Properties
  180. /// <summary>
  181. /// 获取和设置the scope rect
  182. /// </summary>
  183. internal Rect ScopeRect
  184. {
  185. get;
  186. set;
  187. }
  188. #endregion Internal Properties
  189. #endregion Properties
  190. #region Methods
  191. #region Public Methods
  192. /// <summary>
  193. /// Abbreviations this instance.
  194. /// </summary>
  195. /// <returns>System.String.</returns>
  196. public override string Abbreviation()
  197. {
  198. return MenuDescription();
  199. }
  200. /// <summary>
  201. /// Additionals the editors.
  202. /// </summary>
  203. /// <returns>List{ControlPair}.</returns>
  204. public override List<ControlPair> AdditionalEditors()
  205. {
  206. return new List<ControlPair>();
  207. }
  208. /// <summary>
  209. /// Determines whether this instance [can plot on all symbols].
  210. /// </summary>
  211. /// <returns><c>true</c> if this instance [can plot on all symbols]; otherwise, <c>false</c>.</returns>
  212. public override bool CanPlotOnAllSymbols()
  213. {
  214. return false;
  215. }
  216. /// <summary>
  217. /// Determines whether this instance [can save by percent].
  218. /// </summary>
  219. /// <returns><c>true</c> if this instance [can save by percent]; otherwise, <c>false</c>.</returns>
  220. public override bool CanSaveByPercent()
  221. {
  222. return true;
  223. }
  224. /// <summary>
  225. /// Clones this instance.
  226. /// </summary>
  227. /// <returns>IDrawingTool.</returns>
  228. public override IDrawingTool Clone()
  229. {
  230. return new DrawingText
  231. {
  232. mColor = Colors.White
  233. };
  234. }
  235. /// <summary>
  236. /// Descriptions this instance.
  237. /// </summary>
  238. /// <returns>System.String.</returns>
  239. public override string Description()
  240. {
  241. return this.MenuDescription();
  242. }
  243. /// <summary>
  244. /// Icons this instance.
  245. /// </summary>
  246. /// <returns>ImageSource.</returns>
  247. public override ImageSource Icon()
  248. {
  249. ImageSource result = null;
  250. try
  251. {
  252. result = ImageHelper.GetImage("text.png");
  253. }
  254. catch (Exception expr_3A)
  255. {
  256. throw expr_3A;
  257. }
  258. return result;
  259. }
  260. /// <summary>
  261. /// Menus the description.
  262. /// </summary>
  263. /// <returns>System.String.</returns>
  264. public override string MenuDescription()
  265. {
  266. return LanguageManager.FindResource(LanguageConst.DrawingTool_Edit_Description_Text);
  267. }
  268. public override DrawingToolType ToolType()
  269. {
  270. return DrawingToolType.Text;
  271. }
  272. #endregion Public Methods
  273. #region Protected Methods
  274. /// <summary>
  275. /// Adds from info.
  276. /// </summary>
  277. /// <param name="info">The info.</param>
  278. protected override void AddFromInfo(DrawingToolInfo info)
  279. {
  280. base.AddFromInfo(info);
  281. XElement xElement = XElement.Parse(info.XML);
  282. bool flag = xElement.Name == "Root";
  283. if (flag)
  284. {
  285. bool flag2 = xElement.Attribute("StringData1") != null;
  286. if (flag2)
  287. {
  288. this._text = xElement.Attribute("StringData1").Value;
  289. }
  290. flag2 = (xElement.Attribute("Value1") != null);
  291. if (flag2)
  292. {
  293. this._fontSize = (double)XMLHelp.ParseSingle(xElement.Attribute("Value1").Value);
  294. }
  295. }
  296. }
  297. /// <summary>
  298. /// Adds to info.
  299. /// </summary>
  300. /// <param name="info">The info.</param>
  301. protected override void AddToInfo(DrawingToolInfo info)
  302. {
  303. base.AddToInfo(info);
  304. var xElement = new XElement("Root");
  305. xElement.Add(new XAttribute("StringData1", this._text));
  306. xElement.Add(new XAttribute("Value1", (float)this._fontSize));
  307. info.XML = xElement.ToString();
  308. }
  309. /// <summary>
  310. /// Colors the changed.
  311. /// </summary>
  312. protected override void ColorChanged()
  313. {
  314. bool flag = this.Label != null;
  315. if (flag)
  316. {
  317. this.Label.Foreground = (new SolidColorBrush(this.mColor));
  318. }
  319. }
  320. /// <summary>
  321. /// Gets the drawing plots.
  322. /// </summary>
  323. /// <param name="owner">The owner.</param>
  324. /// <param name="aScale">A scale.</param>
  325. /// <param name="aRect">A rect.</param>
  326. /// <returns>List{FrameworkElement}.</returns>
  327. protected override List<FrameworkElement> GetDrawingPlots(Chart owner, ScaleLayer aScale, Rect aRect)
  328. {
  329. var list = new List<FrameworkElement>();
  330. this.ScopeRect = aRect;
  331. bool flag = this.Label == null;
  332. if (flag)
  333. {
  334. this.Label = new TextBlock
  335. {
  336. Cursor = Cursors.Hand,
  337. FontSize = this._fontSize
  338. };
  339. }
  340. this.Label.Foreground = (new SolidColorBrush(this.mColor));
  341. this.Label.Text = (this._text);
  342. flag = (this.LabelBorder == null);
  343. if (flag)
  344. {
  345. this.LabelBorder = new Border
  346. {
  347. Background = (new SolidColorBrush(Colors.Transparent)),
  348. Child = this.Label
  349. };
  350. LabelBorder.CornerRadius = new CornerRadius(4.0);
  351. LabelBorder.Padding = new Thickness(2.0);
  352. }
  353. this.MoveDrawingToNewLocations(aRect);
  354. list.Add(this.LabelBorder);
  355. return list;
  356. }
  357. /// <summary>
  358. /// Moves the drawing to new locations.
  359. /// </summary>
  360. /// <param name="aRect">A rect.</param>
  361. protected override void MoveDrawingToNewLocations(Rect aRect)
  362. {
  363. bool flag = this.LabelBorder != null;
  364. if (flag)
  365. {
  366. this.LabelBorder.SetValue(Canvas.LeftProperty, this.mLastX1);
  367. this.LabelBorder.SetValue(Canvas.TopProperty, this.mLastY1);
  368. flag = (this.Popup != null);
  369. if (flag)
  370. {
  371. Point point = GeometryHelper.PositionOfControlInApp(this.LabelBorder, this.Chart.RootPanel);
  372. this.Popup.HorizontalOffset = point.X - 7.9;// + 3.0;
  373. this.Popup.VerticalOffset = point.Y - 6; //+ 3.0;
  374. }
  375. }
  376. }
  377. /// <summary>
  378. /// Shows the drag handle.
  379. /// </summary>
  380. protected override bool ShowDragHandle()
  381. {
  382. //画Text,不需要draghandle, true:左上角有个隐藏的DrawingSelectionArea
  383. //drawingpointbase.cs - GetPlots用到
  384. return false;
  385. }
  386. #endregion Protected Methods
  387. #region Private Methods
  388. /// <summary>
  389. /// Handles the LostMouseCapture event of the LabelBoder control.
  390. /// </summary>
  391. /// <param name="sender">The source of the event.</param>
  392. /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
  393. private void LabelBoder_LostMouseCapture(object sender, MouseEventArgs e)
  394. {
  395. bool flag = this.Chart != null;
  396. if (flag)
  397. {
  398. this.Chart.LockPainting = false;
  399. this.Chart.Refresh();
  400. }
  401. this._flag = false;
  402. this._isMouseDown = false;
  403. }
  404. /// <summary>
  405. /// Handles the MouseEnter event of the LabelBoder control.
  406. /// </summary>
  407. /// <param name="sender">The source of the event.</param>
  408. /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
  409. private void LabelBoder_MouseEnter(object sender, MouseEventArgs e)
  410. {
  411. if (this.Chart == null) return;
  412. if (this.Chart.PointerType == PointerType.Drawing)
  413. {
  414. this.Label.Cursor = Cursors.None;
  415. _preDrawingTool = this.Chart.CurrentDrawingTool;
  416. this.Chart.PointerType = PointerType.Cursor;
  417. this.Chart.SetCursorImagePos(true, e);
  418. }
  419. else
  420. {
  421. this.Label.Cursor = this.Chart.PointerType == PointerType.Erase ? Cursors.Arrow : Cursors.Hand;
  422. this.LabelBorder.Background = new SolidColorBrush(Color.FromArgb(100, 120, 120, 120));
  423. }
  424. }
  425. /// <summary>
  426. /// Handles the MouseLeave event of the LabelBoder control.
  427. /// </summary>
  428. /// <param name="sender">The source of the event.</param>
  429. /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
  430. private void LabelBoder_MouseLeave(object sender, MouseEventArgs e)
  431. {
  432. if (_preDrawingTool == null)
  433. {
  434. this.LabelBorder.Background = new SolidColorBrush(Colors.Transparent);
  435. }
  436. else
  437. {
  438. this.Chart.CurrentDrawingTool = _preDrawingTool;
  439. this.Chart.SetCursorImagePos(true, e);
  440. _preDrawingTool = null;
  441. }
  442. }
  443. /// <summary>
  444. /// Handles the MouseLeftButtonDown event of the LabelBoder control.
  445. /// </summary>
  446. /// <param name="sender">The source of the event.</param>
  447. /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
  448. private void LabelBoder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  449. {
  450. if (_preDrawingTool != null) return;
  451. bool flag = this.Chart != null;
  452. if (flag)
  453. {
  454. this.Chart.LockPainting = true;
  455. }
  456. this._position = e.GetPosition((UIElement)this.LabelBorder.Parent);
  457. this._isMouseDown = true;
  458. this._flag = false;
  459. this.LabelBorder.CaptureMouse();
  460. this.PrepareToMove();
  461. }
  462. /// <summary>
  463. /// Handles the MouseLeftButtonUp event of the LabelBoder control.
  464. /// </summary>
  465. /// <param name="sender">The source of the event.</param>
  466. /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
  467. private void LabelBoder_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  468. {
  469. if (_preDrawingTool != null) return;
  470. bool flag = this.Chart != null;
  471. if (flag)
  472. {
  473. this.Chart.LockPainting = false;
  474. }
  475. flag = !this._flag;
  476. if (flag)
  477. {
  478. bool flag2 = Chart.PointerType == PointerType.Erase;
  479. if (flag2)
  480. {
  481. this.Delete();
  482. }
  483. else
  484. {
  485. //右键菜单代替,统一画线工具风格
  486. //this.ShowDrawTextEditor();
  487. }
  488. }
  489. else
  490. {
  491. this.MovePlot(e.GetPosition((UIElement)this.LabelBorder.Parent));
  492. bool flag2 = this.OwnerSpec != null;
  493. if (flag2)
  494. {
  495. this.OwnerSpec.ToolChanged(this);
  496. }
  497. this._isMouseDown = false;
  498. flag2 = (this.Chart != null);
  499. if (flag2)
  500. {
  501. this.Chart.Refresh();
  502. }
  503. }
  504. this.LabelBorder.ReleaseMouseCapture();
  505. this._isMouseDown = false;
  506. this._flag = false;
  507. }
  508. /// <summary>
  509. /// Handles the MouseMove event of the LabelBoder control.
  510. /// </summary>
  511. /// <param name="sender">The source of the event.</param>
  512. /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
  513. private void LabelBoder_MouseMove(object sender, MouseEventArgs e)
  514. {
  515. bool flag = this.Chart != null && Chart.PointerType == PointerType.Erase;
  516. if (flag)
  517. {
  518. this.Chart.SetCursorImagePos(true, e);
  519. }
  520. flag = this._isMouseDown;
  521. if (flag)
  522. {
  523. Point position = e.GetPosition((UIElement)this.LabelBorder.Parent);
  524. float num = GeometryHelper.DistanceBetweenPoints(this._position, position);
  525. flag = (num > 8f);
  526. if (flag)
  527. {
  528. this._flag = true;
  529. }
  530. flag = this._flag;
  531. if (flag)
  532. {
  533. this.MovePlot(position);
  534. }
  535. }
  536. }
  537. /// <summary>
  538. /// Handles the MouseRightButtonUp event of the LabelBoder control.
  539. /// </summary>
  540. /// <param name="sender">The source of the event.</param>
  541. /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
  542. private void LabelBoder_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
  543. {
  544. this.ShowPopupMenu(e);
  545. e.Handled = true;
  546. }
  547. /// <summary>
  548. /// Moves the plot.
  549. /// </summary>
  550. /// <param name="curPos">The cur pos.</param>
  551. private void MovePlot(Point curPos)
  552. {
  553. var parent = (FrameworkElement)this.LabelBorder.Parent;
  554. if (parent == null) return;
  555. var height = (float)(parent.ActualHeight - this.LabelBorder.ActualHeight + 10);
  556. height = Math.Max(0, height);
  557. var width = (float)parent.ActualWidth;
  558. width = Math.Max(0, width);
  559. curPos.X = Math.Max(0, curPos.X);
  560. curPos.Y = Math.Max(0, curPos.Y);
  561. curPos.X = Math.Min(curPos.X, width);
  562. curPos.Y = Math.Min(curPos.Y, height);
  563. this.MovePlot(this._position, curPos, new Point(width, height));
  564. }
  565. /// <summary>
  566. /// Handles the Closed event of the Popup control.
  567. /// </summary>
  568. /// <param name="sender">The source of the event.</param>
  569. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  570. private void Popup_Closed(object sender, EventArgs e)
  571. {
  572. if (this.IsRemoveClick)
  573. {
  574. this.IsRemoveClick = false;
  575. return;
  576. }
  577. this.Popup.Child = null;
  578. bool flag = this.Chart != null;
  579. if (string.IsNullOrWhiteSpace(this.Label.Text))
  580. {
  581. this.Delete();
  582. }
  583. if (flag)
  584. {
  585. this.Chart.LockPainting = false;
  586. this.PropertyChanged(); //this._chart.Refresh();
  587. }
  588. this.Popup = null;
  589. }
  590. /// <summary>
  591. /// Removes the text.
  592. /// </summary>
  593. /// <param name="sender">The sender.</param>
  594. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  595. private void RemoveText(object sender, EventArgs e)
  596. {
  597. this.Delete();
  598. this.IsRemoveClick = true;
  599. }
  600. /// <summary>
  601. /// Shows the editor.
  602. /// </summary>
  603. /// <param name="sender">The sender.</param>
  604. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  605. private void ShowEditor(object sender, EventArgs e)
  606. {
  607. bool flag = this.Chart != null;
  608. if (flag)
  609. {
  610. this.Popup = PopupManager.CreateOverlay(this.Chart.RootPanel);
  611. var drawingTextEditor = new DrawingTextEditor(this, this.Popup);
  612. this.Popup.Child = drawingTextEditor;
  613. drawingTextEditor.ShowIt();
  614. this.Popup.IsOpen = true;
  615. this.Chart.LockPainting = false;
  616. this.Chart.Refresh();
  617. }
  618. }
  619. /// <summary>
  620. /// Shows the popup menu.
  621. /// </summary>
  622. /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
  623. private void ShowPopupMenu(MouseEventArgs e)
  624. {
  625. var popUpMenu = new PopupMenu(this.Chart.RootPanel) { FontSize = this.GetChartFontSize() };
  626. popUpMenu.AddItem(LanguageManager.FindResource(LanguageConst.DrawingTool_MenuItem_Edit), ImageHelper.GetImage("PropertiesHS.png"), new EventHandler(this.ShowEditor));
  627. popUpMenu.AddSeperator();
  628. popUpMenu.AddItem(LanguageManager.FindResource(LanguageConst.DrawingTool_MenuItem_Remove), ImageHelper.GetImage("DeleteHS.png"), new EventHandler(this.RemoveText));
  629. popUpMenu.Show(e, new Point(-5.0, -5.0));
  630. }
  631. #endregion Private Methods
  632. #endregion Methods
  633. #region Other
  634. //private void ShowDrawTextEditor()
  635. //{
  636. // bool flag = this.Chart != null;
  637. // if (flag)
  638. // {
  639. // this.Chart.LockPainting = true;
  640. // this.Popup = PopupManager.CreateOverlay(this.Chart.RootPanel);
  641. // var drawingTextEditor = new DrawingTextEditor(this, this.Popup);
  642. // this.Popup.Child = drawingTextEditor;
  643. // drawingTextEditor.ShowIt();
  644. // this.Popup.IsOpen = true;
  645. // }
  646. //}
  647. #endregion Other
  648. }
  649. }