Plot.Properties.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="Plot.Properties.cs" company="OxyPlot">
  3. // Copyright (c) 2014 OxyPlot contributors
  4. // </copyright>
  5. // <summary>
  6. // Represents a control that displays a <see cref="PlotModel" />.
  7. // </summary>
  8. // --------------------------------------------------------------------------------------------------------------------
  9. using Avalonia;
  10. using Avalonia.Media;
  11. namespace OxyPlot.Avalonia
  12. {
  13. using global::Avalonia.Metadata;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Collections.ObjectModel;
  17. using System.Globalization;
  18. /// <summary>
  19. /// Represents a control that displays a <see cref="PlotModel" />.
  20. /// </summary>
  21. /// <remarks>This file contains dependency properties used for defining the Plot in XAML. These properties are only used when Model is <c>null</c>. In this case an internal PlotModel is created and the dependency properties are copied from the control to the internal PlotModel.</remarks>
  22. public partial class Plot
  23. {
  24. /// <summary>
  25. /// Identifies the <see cref="Culture"/> dependency property.
  26. /// </summary>
  27. public static readonly StyledProperty<CultureInfo> CultureProperty = AvaloniaProperty.Register<Plot, CultureInfo>(nameof(Culture), null);
  28. /// <summary>
  29. /// Identifies the <see cref="IsLegendVisible"/> dependency property.
  30. /// </summary>
  31. public static readonly StyledProperty<bool> IsLegendVisibleProperty = AvaloniaProperty.Register<Plot, bool>(nameof(IsLegendVisible), true);
  32. /// <summary>
  33. /// Identifies the <see cref="SelectionColor"/> dependency property.
  34. /// </summary>
  35. public static readonly StyledProperty<Color> SelectionColorProperty = AvaloniaProperty.Register<Plot, Color>(nameof(SelectionColor), Colors.Yellow);
  36. /// <summary>
  37. /// Identifies the <see cref="RenderingDecorator"/> dependency property.
  38. /// </summary>
  39. public static readonly StyledProperty<Func<IRenderContext, IRenderContext>> RenderingDecoratorProperty = AvaloniaProperty.Register<Plot, Func<IRenderContext, IRenderContext>>(nameof(RenderingDecorator), null);
  40. /// <summary>
  41. /// Identifies the <see cref="SubtitleFont"/> dependency property.
  42. /// </summary>
  43. public static readonly StyledProperty<string> SubtitleFontProperty = AvaloniaProperty.Register<Plot, string>(nameof(SubtitleFont), null);
  44. /// <summary>
  45. /// Identifies the <see cref="TitleColor"/> dependency property.
  46. /// </summary>
  47. public static readonly StyledProperty<Color> TitleColorProperty = AvaloniaProperty.Register<Plot, Color>(nameof(TitleColor), MoreColors.Automatic);
  48. /// <summary>
  49. /// Identifies the <see cref="SubtitleColor"/> dependency property.
  50. /// </summary>
  51. public static readonly StyledProperty<Color> SubtitleColorProperty = AvaloniaProperty.Register<Plot, Color>(nameof(SubtitleColor), MoreColors.Automatic);
  52. /// <summary>
  53. /// Identifies the <see cref="DefaultFont"/> dependency property.
  54. /// </summary>
  55. public static readonly StyledProperty<string> DefaultFontProperty = AvaloniaProperty.Register<Plot, string>(nameof(DefaultFont), "Segoe UI");
  56. /// <summary>
  57. /// Identifies the <see cref="DefaultFontSize"/> dependency property.
  58. /// </summary>
  59. public static readonly StyledProperty<double> DefaultFontSizeProperty = AvaloniaProperty.Register<Plot, double>(nameof(DefaultFontSize), 12d);
  60. /// <summary>
  61. /// Identifies the <see cref="DefaultColors"/> dependency property.
  62. /// </summary>
  63. public static readonly StyledProperty<IList<Color>> DefaultColorsProperty = AvaloniaProperty.Register<Plot, IList<Color>>(nameof(DefaultColors), new[]
  64. {
  65. Color.FromRgb(0x4E, 0x9A, 0x06),
  66. Color.FromRgb(0xC8, 0x8D, 0x00),
  67. Color.FromRgb(0xCC, 0x00, 0x00),
  68. Color.FromRgb(0x20, 0x4A, 0x87),
  69. Colors.Red,
  70. Colors.Orange,
  71. Colors.Yellow,
  72. Colors.Green,
  73. Colors.Blue,
  74. Colors.Indigo,
  75. Colors.Violet
  76. });
  77. /// <summary>
  78. /// Identifies the <see cref="AxisTierDistance"/> dependency property.
  79. /// </summary>
  80. public static readonly StyledProperty<double> AxisTierDistanceProperty = AvaloniaProperty.Register<Plot, double>(nameof(AxisTierDistance), 4d);
  81. /// <summary>
  82. /// Identifies the <see cref="PlotAreaBackground"/> dependency property.
  83. /// </summary>
  84. public static readonly StyledProperty<Brush> PlotAreaBackgroundProperty = AvaloniaProperty.Register<Plot, Brush>(nameof(PlotAreaBackground), null);
  85. /// <summary>
  86. /// Identifies the <see cref="PlotAreaBorderColor"/> dependency property.
  87. /// </summary>
  88. public static readonly StyledProperty<Color> PlotAreaBorderColorProperty = AvaloniaProperty.Register<Plot, Color>(nameof(PlotAreaBorderColor), Colors.Black);
  89. /// <summary>
  90. /// Identifies the <see cref="PlotAreaBorderThickness"/> dependency property.
  91. /// </summary>
  92. public static readonly StyledProperty<Thickness> PlotAreaBorderThicknessProperty = AvaloniaProperty.Register<Plot, Thickness>(nameof(PlotAreaBorderThickness), new Thickness(1.0));
  93. /// <summary>
  94. /// Identifies the <see cref="PlotMargins"/> dependency property.
  95. /// </summary>
  96. public static readonly StyledProperty<Thickness> PlotMarginsProperty = AvaloniaProperty.Register<Plot, Thickness>(nameof(PlotMargins), new Thickness(double.NaN));
  97. /// <summary>
  98. /// Identifies the <see cref="PlotType"/> dependency property.
  99. /// </summary>
  100. public static readonly StyledProperty<PlotType> PlotTypeProperty = AvaloniaProperty.Register<Plot, PlotType>(nameof(PlotType), PlotType.XY);
  101. /// <summary>
  102. /// Identifies the <see cref="SubtitleFontSize"/> dependency property.
  103. /// </summary>
  104. public static readonly StyledProperty<double> SubtitleFontSizeProperty = AvaloniaProperty.Register<Plot, double>(nameof(SubtitleFontSize), 14.0);
  105. /// <summary>
  106. /// Identifies the <see cref="SubtitleFontWeight"/> dependency property.
  107. /// </summary>
  108. public static readonly StyledProperty<FontWeight> SubtitleFontWeightProperty = AvaloniaProperty.Register<Plot, FontWeight>(nameof(SubtitleFontWeight), FontWeight.Normal);
  109. /// <summary>
  110. /// Identifies the <see cref="Subtitle"/> dependency property.
  111. /// </summary>
  112. public static readonly StyledProperty<string> SubtitleProperty = AvaloniaProperty.Register<Plot, string>(nameof(Subtitle), null);
  113. /// <summary>
  114. /// Identifies the <see cref="TextColor"/> dependency property.
  115. /// </summary>
  116. public static readonly StyledProperty<Color> TextColorProperty = AvaloniaProperty.Register<Plot, Color>(nameof(TextColor), Colors.Black);
  117. /// <summary>
  118. /// Identifies the <see cref="TitleHorizontalAlignment"/> dependency property.
  119. /// </summary>
  120. public static readonly StyledProperty<TitleHorizontalAlignment> TitleAlignmentProperty = AvaloniaProperty.Register<Plot, TitleHorizontalAlignment>(nameof(TitleHorizontalAlignment), TitleHorizontalAlignment.CenteredWithinPlotArea);
  121. /// <summary>
  122. /// Identifies the <see cref="TitleFont"/> dependency property.
  123. /// </summary>
  124. public static readonly StyledProperty<string> TitleFontProperty = AvaloniaProperty.Register<Plot, string>(nameof(TitleFont), null);
  125. /// <summary>
  126. /// Identifies the <see cref="TitleFontSize"/> dependency property.
  127. /// </summary>
  128. public static readonly StyledProperty<double> TitleFontSizeProperty = AvaloniaProperty.Register<Plot, double>(nameof(TitleFontSize), 18.0);
  129. /// <summary>
  130. /// Identifies the <see cref="TitleFontWeight"/> dependency property.
  131. /// </summary>
  132. public static readonly StyledProperty<FontWeight> TitleFontWeightProperty = AvaloniaProperty.Register<Plot, FontWeight>(nameof(TitleFontWeight), FontWeight.Bold);
  133. /// <summary>
  134. /// Identifies the <see cref="TitlePadding"/> dependency property.
  135. /// </summary>
  136. public static readonly StyledProperty<double> TitlePaddingProperty = AvaloniaProperty.Register<Plot, double>(nameof(TitlePadding), 6.0);
  137. /// <summary>
  138. /// Identifies the <see cref="Title"/> dependency property.
  139. /// </summary>
  140. public static readonly StyledProperty<string> TitleProperty = AvaloniaProperty.Register<Plot, string>(nameof(Title), null);
  141. /// <summary>
  142. /// Identifies the <see cref="TitleToolTip"/> dependency property.
  143. /// </summary>
  144. public static readonly StyledProperty<string> TitleToolTipProperty = AvaloniaProperty.Register<Plot, string>(nameof(TitleToolTip), null);
  145. /// <summary>
  146. /// Identifies the <see cref="InvalidateFlag"/> dependency property.
  147. /// </summary>
  148. public static readonly StyledProperty<int> InvalidateFlagProperty = AvaloniaProperty.Register<Plot, int>(nameof(InvalidateFlag), 0);
  149. /// <summary>
  150. /// Initializes static members of the <see cref="Plot" /> class.
  151. /// </summary>
  152. static Plot()
  153. {
  154. PaddingProperty.OverrideDefaultValue<Plot>(new Thickness(8));
  155. PaddingProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  156. CultureProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  157. IsLegendVisibleProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  158. SelectionColorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  159. RenderingDecoratorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  160. SubtitleFontProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  161. TitleColorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  162. SubtitleColorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  163. DefaultFontProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  164. DefaultFontSizeProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  165. DefaultColorsProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  166. AxisTierDistanceProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  167. PlotAreaBackgroundProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  168. PlotAreaBorderColorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  169. PlotAreaBorderThicknessProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  170. PlotMarginsProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  171. PlotTypeProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  172. SubtitleFontSizeProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  173. SubtitleFontWeightProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  174. SubtitleProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  175. TextColorProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  176. TitleAlignmentProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  177. TitleFontProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  178. TitleFontSizeProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  179. TitleFontWeightProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  180. TitlePaddingProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  181. TitleProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  182. TitleToolTipProperty.Changed.AddClassHandler<Plot>(AppearanceChanged);
  183. InvalidateFlagProperty.Changed.AddClassHandler<Plot>((s, e) => s.InvalidateFlagChanged());
  184. }
  185. /// <summary>
  186. /// The annotations.
  187. /// </summary>
  188. private readonly ObservableCollection<Annotation> annotations;
  189. /// <summary>
  190. /// The axes.
  191. /// </summary>
  192. private readonly ObservableCollection<Axis> axes;
  193. /// <summary>
  194. /// The series.
  195. /// </summary>
  196. private readonly ObservableCollection<Series> series;
  197. /// <summary>
  198. /// The legends.
  199. /// </summary>
  200. private readonly ObservableCollection<Legend> legends;
  201. /// <summary>
  202. /// Gets the axes.
  203. /// </summary>
  204. /// <value>The axes.</value>
  205. public Collection<Axis> Axes
  206. {
  207. get
  208. {
  209. return axes;
  210. }
  211. }
  212. /// <summary>
  213. /// Gets or sets Culture.
  214. /// </summary>
  215. public CultureInfo Culture
  216. {
  217. get
  218. {
  219. return GetValue(CultureProperty);
  220. }
  221. set
  222. {
  223. SetValue(CultureProperty, value);
  224. }
  225. }
  226. /// <summary>
  227. /// Gets or sets a value indicating whether IsLegendVisible.
  228. /// </summary>
  229. public bool IsLegendVisible
  230. {
  231. get
  232. {
  233. return GetValue(IsLegendVisibleProperty);
  234. }
  235. set
  236. {
  237. SetValue(IsLegendVisibleProperty, value);
  238. }
  239. }
  240. /// <summary>
  241. /// Gets or sets the default font.
  242. /// </summary>
  243. public string DefaultFont
  244. {
  245. get
  246. {
  247. return GetValue(DefaultFontProperty);
  248. }
  249. set
  250. {
  251. SetValue(DefaultFontProperty, value);
  252. }
  253. }
  254. /// <summary>
  255. /// Gets or sets the default font size.
  256. /// </summary>
  257. public double DefaultFontSize
  258. {
  259. get
  260. {
  261. return GetValue(DefaultFontSizeProperty);
  262. }
  263. set
  264. {
  265. SetValue(DefaultFontSizeProperty, value);
  266. }
  267. }
  268. /// <summary>
  269. /// Gets or sets the default colors.
  270. /// </summary>
  271. public IList<Color> DefaultColors
  272. {
  273. get
  274. {
  275. return GetValue(DefaultColorsProperty);
  276. }
  277. set
  278. {
  279. SetValue(DefaultColorsProperty, value);
  280. }
  281. }
  282. /// <summary>
  283. /// Gets or sets the axis tier distance.
  284. /// </summary>
  285. public double AxisTierDistance
  286. {
  287. get
  288. {
  289. return GetValue(AxisTierDistanceProperty);
  290. }
  291. set
  292. {
  293. SetValue(AxisTierDistanceProperty, value);
  294. }
  295. }
  296. /// <summary>
  297. /// Gets or sets the color of selected elements.
  298. /// </summary>
  299. public Color SelectionColor
  300. {
  301. get
  302. {
  303. return GetValue(SelectionColorProperty);
  304. }
  305. set
  306. {
  307. SetValue(SelectionColorProperty, value);
  308. }
  309. }
  310. /// <summary>
  311. /// Gets or sets a rendering decorator.
  312. /// </summary>
  313. public Func<IRenderContext, IRenderContext> RenderingDecorator
  314. {
  315. get
  316. {
  317. return GetValue(RenderingDecoratorProperty);
  318. }
  319. set
  320. {
  321. SetValue(RenderingDecoratorProperty, value);
  322. }
  323. }
  324. /// <summary>
  325. /// Gets or sets the font of the subtitles.
  326. /// </summary>
  327. public string SubtitleFont
  328. {
  329. get
  330. {
  331. return GetValue(SubtitleFontProperty);
  332. }
  333. set
  334. {
  335. SetValue(SubtitleFontProperty, value);
  336. }
  337. }
  338. /// <summary>
  339. /// Gets or sets the color of the titles.
  340. /// </summary>
  341. public Color TitleColor
  342. {
  343. get
  344. {
  345. return GetValue(TitleColorProperty);
  346. }
  347. set
  348. {
  349. SetValue(TitleColorProperty, value);
  350. }
  351. }
  352. /// <summary>
  353. /// Gets or sets the color of the subtitles.
  354. /// </summary>
  355. public Color SubtitleColor
  356. {
  357. get
  358. {
  359. return GetValue(SubtitleColorProperty);
  360. }
  361. set
  362. {
  363. SetValue(SubtitleColorProperty, value);
  364. }
  365. }
  366. /// <summary>
  367. /// Gets or sets the background brush of the Plot area.
  368. /// </summary>
  369. /// <value>The brush.</value>
  370. public Brush PlotAreaBackground
  371. {
  372. get
  373. {
  374. return GetValue(PlotAreaBackgroundProperty);
  375. }
  376. set
  377. {
  378. SetValue(PlotAreaBackgroundProperty, value);
  379. }
  380. }
  381. /// <summary>
  382. /// Gets or sets the color of the Plot area border.
  383. /// </summary>
  384. /// <value>The color of the Plot area border.</value>
  385. public Color PlotAreaBorderColor
  386. {
  387. get
  388. {
  389. return GetValue(PlotAreaBorderColorProperty);
  390. }
  391. set
  392. {
  393. SetValue(PlotAreaBorderColorProperty, value);
  394. }
  395. }
  396. /// <summary>
  397. /// Gets or sets the thickness of the Plot area border.
  398. /// </summary>
  399. /// <value>The thickness of the Plot area border.</value>
  400. public Thickness PlotAreaBorderThickness
  401. {
  402. get
  403. {
  404. return GetValue(PlotAreaBorderThicknessProperty);
  405. }
  406. set
  407. {
  408. SetValue(PlotAreaBorderThicknessProperty, value);
  409. }
  410. }
  411. /// <summary>
  412. /// Gets or sets the Plot margins.
  413. /// </summary>
  414. /// <value>The Plot margins.</value>
  415. public Thickness PlotMargins
  416. {
  417. get
  418. {
  419. return GetValue(PlotMarginsProperty);
  420. }
  421. set
  422. {
  423. SetValue(PlotMarginsProperty, value);
  424. }
  425. }
  426. /// <summary>
  427. /// Gets or sets PlotType.
  428. /// </summary>
  429. public PlotType PlotType
  430. {
  431. get
  432. {
  433. return GetValue(PlotTypeProperty);
  434. }
  435. set
  436. {
  437. SetValue(PlotTypeProperty, value);
  438. }
  439. }
  440. /// <summary>
  441. /// Gets the series.
  442. /// </summary>
  443. /// <value>The series.</value>
  444. [Content]
  445. public Collection<Series> Series
  446. {
  447. get
  448. {
  449. return series;
  450. }
  451. }
  452. /// <summary>
  453. /// Gets the legends.
  454. /// </summary>
  455. /// <value>The legends.</value>
  456. public Collection<Legend> Legends
  457. {
  458. get
  459. {
  460. return legends;
  461. }
  462. }
  463. /// <summary>
  464. /// Gets or sets the subtitle.
  465. /// </summary>
  466. /// <value>The subtitle.</value>
  467. public string Subtitle
  468. {
  469. get
  470. {
  471. return GetValue(SubtitleProperty);
  472. }
  473. set
  474. {
  475. SetValue(SubtitleProperty, value);
  476. }
  477. }
  478. /// <summary>
  479. /// Gets or sets the font size of the subtitle.
  480. /// </summary>
  481. public double SubtitleFontSize
  482. {
  483. get
  484. {
  485. return GetValue(SubtitleFontSizeProperty);
  486. }
  487. set
  488. {
  489. SetValue(SubtitleFontSizeProperty, value);
  490. }
  491. }
  492. /// <summary>
  493. /// Gets or sets the font weight of the subtitle.
  494. /// </summary>
  495. public FontWeight SubtitleFontWeight
  496. {
  497. get
  498. {
  499. return GetValue(SubtitleFontWeightProperty);
  500. }
  501. set
  502. {
  503. SetValue(SubtitleFontWeightProperty, value);
  504. }
  505. }
  506. /// <summary>
  507. /// Gets or sets text color.
  508. /// </summary>
  509. public Color TextColor
  510. {
  511. get
  512. {
  513. return GetValue(TextColorProperty);
  514. }
  515. set
  516. {
  517. SetValue(TextColorProperty, value);
  518. }
  519. }
  520. /// <summary>
  521. /// Gets or sets the title.
  522. /// </summary>
  523. /// <value>The title.</value>
  524. public string Title
  525. {
  526. get
  527. {
  528. return GetValue(TitleProperty);
  529. }
  530. set
  531. {
  532. SetValue(TitleProperty, value);
  533. }
  534. }
  535. /// <summary>
  536. /// Gets or sets the title tool tip.
  537. /// </summary>
  538. /// <value>The title tool tip.</value>
  539. public string TitleToolTip
  540. {
  541. get
  542. {
  543. return GetValue(TitleToolTipProperty);
  544. }
  545. set
  546. {
  547. SetValue(TitleToolTipProperty, value);
  548. }
  549. }
  550. /// <summary>
  551. /// Gets or sets the horizontal alignment of the title and subtitle.
  552. /// </summary>
  553. /// <value>
  554. /// The alignment.
  555. /// </value>
  556. public TitleHorizontalAlignment TitleHorizontalAlignment
  557. {
  558. get
  559. {
  560. return GetValue(TitleAlignmentProperty);
  561. }
  562. set
  563. {
  564. SetValue(TitleAlignmentProperty, value);
  565. }
  566. }
  567. /// <summary>
  568. /// Gets or sets font of the title.
  569. /// </summary>
  570. public string TitleFont
  571. {
  572. get
  573. {
  574. return GetValue(TitleFontProperty);
  575. }
  576. set
  577. {
  578. SetValue(TitleFontProperty, value);
  579. }
  580. }
  581. /// <summary>
  582. /// Gets or sets font size of the title.
  583. /// </summary>
  584. public double TitleFontSize
  585. {
  586. get
  587. {
  588. return GetValue(TitleFontSizeProperty);
  589. }
  590. set
  591. {
  592. SetValue(TitleFontSizeProperty, value);
  593. }
  594. }
  595. /// <summary>
  596. /// Gets or sets font weight of the title.
  597. /// </summary>
  598. public FontWeight TitleFontWeight
  599. {
  600. get
  601. {
  602. return GetValue(TitleFontWeightProperty);
  603. }
  604. set
  605. {
  606. SetValue(TitleFontWeightProperty, value);
  607. }
  608. }
  609. /// <summary>
  610. /// Gets or sets padding around the title.
  611. /// </summary>
  612. public double TitlePadding
  613. {
  614. get
  615. {
  616. return GetValue(TitlePaddingProperty);
  617. }
  618. set
  619. {
  620. SetValue(TitlePaddingProperty, value);
  621. }
  622. }
  623. /// <summary>
  624. /// Gets or sets the refresh flag (an integer value). When the flag is changed, the Plot will be refreshed.
  625. /// </summary>
  626. /// <value>The refresh value.</value>
  627. public int InvalidateFlag
  628. {
  629. get
  630. {
  631. return GetValue(InvalidateFlagProperty);
  632. }
  633. set
  634. {
  635. SetValue(InvalidateFlagProperty, value);
  636. }
  637. }
  638. /// <summary>
  639. /// Invalidates the Plot control/view when the <see cref="InvalidateFlag" /> property is changed.
  640. /// </summary>
  641. private void InvalidateFlagChanged()
  642. {
  643. InvalidatePlot();
  644. }
  645. }
  646. }