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 CPOL
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
<!--revision $Id: dlgChartScales.xaml 18093 2009-03-16 04:15:06Z unknown $-->
<Window x:Class="WellLogControlSample.dlgChartScales"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:WellLogControlSample"
	WindowStartupLocation="CenterOwner"
	FocusManager.FocusedElement="{Binding ElementName=txtDepthScale}"
	SizeToContent="WidthAndHeight" ResizeMode="NoResize"
	Title="Chart Scales"
	BorderBrush="Cornsilk" BorderThickness="15" 
	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>
		<Style TargetType="{x:Type TextBox}">
			<Setter Property="Validation.ErrorTemplate">
				<Setter.Value>
					<ControlTemplate>
						<DockPanel LastChildFill="True">
							<TextBlock DockPanel.Dock="Right" Foreground="Red"
								FontSize="16" FontWeight="Bold"
								ToolTip="{Binding ElementName=adornerPlaceholder, 
									Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
								Text=" !"/>
							<Border BorderBrush="Red" BorderThickness="2">
								<AdornedElementPlaceholder Name="adornerPlaceholder"/>
							</Border>
						</DockPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="Auto"/>
		</Grid.ColumnDefinitions>

		<!-- DepthScale row -->
		<Label Target="{Binding ElementName=txtDepthScale}">Depth Scale</Label>
		<TextBox Grid.Column="1" Name="txtDepthScale"
			 Text="{Binding Path=DepthScale, UpdateSourceTrigger=PropertyChanged,
				ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

		<!-- ChartWidth row -->
		<Label Grid.Row="1" Target="{Binding ElementName=txtChartWidth}">Chart Width</Label>
		<TextBox Grid.Row="1" Grid.Column="1" Name="txtChartWidth"
			 Text="{Binding Path=ChartWidth, UpdateSourceTrigger=PropertyChanged,
				ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

		<!-- Dialog buttons row -->
		<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" 
					HorizontalAlignment="Right" VerticalAlignment="Bottom">
			<Button Name="btnOK" Click="btnOK_Click"  Style="{StaticResource dialogButton}" IsDefault="True" IsEnabled="False">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)

Share

About the Author

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

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