Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

OpenWPFChart: Assembling Charts from Components. Part II - Controls

, 26 Mar 2009
Chart controls composed from Chart Parts
SourceCode.zip
trunk
ChartControls
ChartControls.csproj.user
OpenWPFChart.Chart.Icon.png
OpenWPFChart.WellLogChart.Icon.png
Properties
Themes
ChartHelpers
AxisPropertiesDialog
ChartHelpers.csproj.user
ChartScaleControl
FontChooser
ItemPropertiesDialog
Properties
ChartParts
Axes
ChartParts.csproj.user
Grid
Items
Data
DataView
Elements
Visuals
NumericalRecipes
Properties
Scales
SampleDataFiles
WellLog
Samples
ControlSamples
ColumnChartControlSample
Properties
Settings.settings
CurveChartControlSample
Properties
Settings.settings
r3xyqstb.tmp_proj
WellLogControlSample
Properties
Settings.settings
DirectCompositionSamples
BasicSample
Properties
Settings.settings
TemperatureSample
Properties
Settings.settings
WellLogSample
Properties
Settings.settings
// <copyright file="ItemVisual.cs" company="Oleg V. Polikarpotchkin">
// Copyright © 2008 Oleg V. Polikarpotchkin. All Right Reserved
// </copyright>
// <author>Oleg V. Polikarpotchkin</author>
// <email>ov-p@yandex.ru</email>
// <date>2008-12-23</date>
// <summary>OpenWPFChart library. OpenWPFChart Item Visual's abstract base class.</summary>
// <revision>$Id: ItemVisual.cs 18093 2009-03-16 04:15:06Z unknown $</revision>

using System;
using System.ComponentModel; // For ISupportInitialize
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;

namespace OpenWPFChart.Parts
{
	/// <summary>
	/// OpenWPFChart Item Visual's abstract base class.
	/// </summary>
	public abstract class ItemVisual : DrawingVisual
	{
		#region Dependency properties
		#region ItemDataView
		/// <summary>
		/// Identifies the ItemDataView dependency property.
		/// </summary>
		public static readonly DependencyProperty ItemDataViewProperty
			= Item.ItemDataViewProperty.AddOwner(typeof(ItemVisual));
		/// <summary>
		/// Gets or sets the ItemDataView property.
		/// </summary>
		/// <value>ItemData value</value>
		public ItemDataView ItemDataView
		{
			get { return (ItemDataView)GetValue(ItemDataViewProperty); }
			set { SetValue(ItemDataViewProperty, value); }
		}
		#endregion ItemData
		#endregion Dependency properties

		/// <summary>
		/// Render Curve Visual.
		/// </summary>
		protected internal abstract void Render();

		/// <summary>
		/// Checks the 'pt' is inside the area. All coordinates come in pixels.
		/// </summary>
		/// <param name="pt">The pt.</param>
		/// <param name="area">The area.</param>
		/// <returns>
		/// 	<c>true</c> if the specified pt is inside the area; otherwise, <c>false</c>.
		/// </returns>
		protected static bool isInsideArea(Point pt, Size area)
		{
			Debug.Assert(area.Width >= 0, "area.Width >= 0");
			Debug.Assert(area.Height >= 0, "area.Height >= 0");
			if (pt.X < 0 || pt.X > area.Width || pt.Y < 0 || pt.Y > area.Height)
				return false;
			return true;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Oleg V. Polikarpotchkin
Team Leader
Russian Federation Russian Federation
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 26 Mar 2009
Article Copyright 2009 by Oleg V. Polikarpotchkin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid