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 I - Parts

, 19 Mar 2009
Provides the component model along with base components to assemble charts.
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
ChartParts.vsmdi
SampleDataFiles
WellLog
Samples
ControlSamples
ColumnChartControlSample
Properties
Settings.settings
CurveChartControlSample
Properties
Settings.settings
WellLogControlSample
Properties
Settings.settings
DirectCompositionSamples
BasicSample
Properties
Settings.settings
TemperatureSample
Properties
Settings.settings
WellLogSample
Properties
Settings.settings
<Window x:Class="ovp.CurveChart.dlgPointMarker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
    Title="Select Point Marker" ShowInTaskbar="False"
	SizeToContent="WidthAndHeight" ResizeMode="NoResize" 
	MinWidth="150" MinHeight="100"  WindowStartupLocation="CenterOwner"
	FocusManager.FocusedElement="{Binding ElementName=txtCurveName}"
	BorderBrush="Cornsilk" BorderThickness="10" 
	Background="AliceBlue"
	>

	<Window.Resources>
		<Style TargetType="Label">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="Padding" Value="5" />
		</Style>
		<!--<Style TargetType="Button">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="Margin" Value="5, 10, 5, 5" />
		</Style>-->
		<Style x:Key="dialogButton" TargetType="Button">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="Margin" Value="5, 10, 5, 5" />
			<Setter Property="Width" Value="72" />
		</Style>

		<!-- Marker Geometries -->
		<!--<x:ArrayExtension x:Key="markerShapes" Type="{x:Type Geometry}">
			<EllipseGeometry Center="0,0" RadiusX="4" RadiusY="4"/>
			<RectangleGeometry Rect="-4,-4,8,8"/>
		</x:ArrayExtension>-->
		<collections:ArrayList x:Key="markerShapes">
			<EllipseGeometry Center="0,0" RadiusX="4" RadiusY="4"/>
			<RectangleGeometry Rect="-4,-4,8,8"/>
			<PathGeometry>
				<PathFigure StartPoint="-4,4" IsClosed="True">
					<PolyLineSegment Points="4,4 0,-4" />
				</PathFigure>
			</PathGeometry>
			<PathGeometry>
				<PathFigure StartPoint="-4,-4" IsClosed="True">
					<PolyLineSegment Points="4,-4 0,4" />
				</PathFigure>
			</PathGeometry>
		</collections:ArrayList>
	</Window.Resources>
	
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition/>
		</Grid.ColumnDefinitions>
		
		<Label Target="{Binding ElementName=lbxMarkers}">Marker Gometry</Label>
		<ListBox Grid.Column="1" Name="lbxMarkers" ItemsSource="{StaticResource markerShapes}"
				 SelectionChanged="lbxMarkers_SelectionChanged">
			<ListBox.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel/>
				</ItemsPanelTemplate>
			</ListBox.ItemsPanel>
			
			<ListBox.ItemTemplate>
				<DataTemplate>
					<Path Data="{Binding}" Stroke="Black" Margin="5" />
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>

		<Label Grid.Row="1" Target="{Binding ElementName=btnMarkerStrokeColor}">Marker Color</Label>
		<Button Grid.Row="1" Grid.Column="1" Name="btnMarkerStrokeColor" Click="btnMarkerStrokeColor_Click" 
				ToolTip="Click to select the Marker Color">
			<Rectangle Width="50" Height="17">
				<Rectangle.Fill>
					<SolidColorBrush Color="{Binding MarkerStrokeColor}"/>
				</Rectangle.Fill>
			</Rectangle>
		</Button>

		<Label Grid.Row="2" Target="{Binding ElementName=btnMarkerFillColor}">Marker Fill Color</Label>
		<Button Grid.Row="2" Grid.Column="1" Name="btnMarkerFillColor" Click="btnMarkerFillColor_Click" 
				ToolTip="Click to select the Marker Fill Color">
			<Rectangle Width="50" Height="17">
				<Rectangle.Fill>
					<SolidColorBrush Color="{Binding MarkerFillColor}"/>
				</Rectangle.Fill>
			</Rectangle>
			
			<!--<Button.Style>
				<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
					<Style.Triggers>
						<Trigger Value="{x:Type GeometryDrawing}">
							<Trigger.Property>
								<Binding Path="MarkerType" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type Window}}"/>
							</Trigger.Property>
							<Setter Property="Visibility" Value="Visible"/>
						</Trigger>
					</Style.Triggers>
				</Style>
			</Button.Style>-->
		</Button>

		<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal" 
					HorizontalAlignment="Right" VerticalAlignment="Bottom">
			<Button Name="btnOK" Click="btnOK_Click" Style="{StaticResource dialogButton}" 
					IsEnabled="False" IsDefault="True">OK</Button>
			<Button Style="{StaticResource dialogButton}" IsCancel="True">Cancel</Button>
		</StackPanel>
	</Grid>
</Window>

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
Web01 | 2.8.140718.1 | Last Updated 19 Mar 2009
Article Copyright 2009 by Oleg V. Polikarpotchkin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid